Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-15-2019, 06:12 AM   #1
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Open Forms in Datasheet View (All Records)

Hello,


On my Main Form I have command buttons for Customers, Descriptions, and Part Numbers. I would like these to open to datasheet view for all records from the Main Form. I have these password protected ("admin") for the Administrator to edit if needed.


Is there a way to do this? I don't want to affect the Clerk form (password "clerk") for entering new Customers, new Descriptions, or new Part Numbers if needed on there. The 3 forms are set to data entry.


I am not sure if this can be done separately or not.



I appreciate any help,
Bill


Last edited by billgyrotech; 08-05-2019 at 02:10 AM.
billgyrotech is offline   Reply With Quote
Old 07-15-2019, 08:16 AM   #2
Ranman256
Newly Registered User
 
Join Date: Apr 2015
Location: KY,USA
Posts: 3,334
Thanks: 0
Thanked 735 Times in 720 Posts
Ranman256 will become famous soon enough Ranman256 will become famous soon enough
Re: Open Forms in Datasheet View (All Records)

i have various forms. admin has all rights,
mgr has some rights (edit/add)
user has little rights: view only, no add,delete, etc

i capture user ID when the main form opens (users dont see it)
then look up his rights in the tUsers table.

Code:
Private Sub Form_Load()
txtUser = getUserID()
txtRights = dlookup("[rights]","tUsers","[userid]='" & txtUser & "'")
End Sub

Public Function getUserID() As String
getUserID = Environ("Username")
End Function
then the user clicks button on the menu, the logic opens THAT form.
Code:
sub btnVwCustomers()
   select case me.txtRights
       case "U"
         docmd.openform "fCustomersU"
       case "M"
         docmd.openform "fCustomersM"
       case "A"
         docmd.openform "fCustomersA"
   end select
end sub
or you could just set the restrictions on a single form, depending on the user rights.
Ranman256 is offline   Reply With Quote
The Following User Says Thank You to Ranman256 For This Useful Post:
billgyrotech (07-15-2019)
Old 07-15-2019, 09:35 AM   #3
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Open Forms in Datasheet View (All Records)

Thanks for the reply but I was maybe not clear. From the main form I want those to open to datasheet view please showing all customers for instance.

billgyrotech is offline   Reply With Quote
Old 07-15-2019, 11:01 AM   #4
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,067
Thanks: 81
Thanked 1,592 Times in 1,478 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Open Forms in Datasheet View (All Records)

The issue of opening in datasheet view is possible. Are you looking at opening a query in datasheet view?

https://docs.microsoft.com/en-us/off...ocmd.openquery

This would do it and you can tell Access whether the view is read-only or not based on the third parameter of the .OpenQuery method. Click on the blue text for the 2nd and 3rd parameters in that article to see the options for each parameter. Note that doing this would open the datasheet according to the sizing at which that query was last saved in datasheet mode. So if you last opened the query in full-screen size, this will open in full-screen size.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
billgyrotech (07-15-2019)
Old 07-15-2019, 11:08 AM   #5
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Open Forms in Datasheet View (All Records)

Oh so I should create a query and then open that?


I hope that is correct.
billgyrotech is offline   Reply With Quote
Old 07-15-2019, 11:15 AM   #6
billgyrotech
Banned
 
Join Date: Apr 2013
Posts: 258
Thanks: 67
Thanked 3 Times in 3 Posts
billgyrotech is an unknown quantity at this point
Re: Open Forms in Datasheet View (All Records)

Thanks Doc that works using the command buttons to open the queries I really appreciate the help.
billgyrotech is offline   Reply With Quote
Old 07-15-2019, 11:24 AM   #7
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,067
Thanks: 81
Thanked 1,592 Times in 1,478 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Open Forms in Datasheet View (All Records)

Billy, my correct answer to #5's question is "No, you shouldn't create a query or a form. You should create whatever works correctly for you." But I gave you the easiest answer so you could get things up and running faster.

Please note that there can be reasons why you would not want to use a query. For one, it is harder to filter the recordset if it ever becomes necessary to hide certain records from certain people based on their role. That becomes harder when opening a stored query using this method, and .OpenQuery requires a query name, not a query (SQL) string. For another, there is no easy error or range checking on queries opened in datasheet mode.

Down the road, if you need to consider filtering what everyone sees, you might need to consider opening a form in continuous mode (which looks similar to a datasheet but isn't one). Forms can have an extant .Recordsource query but can have filters added after the fact by diddling with the form's .Filter and .FilterOn properties. Forms can also do "sanity" checking to verify that a given input makes sense in context.

Therefore, if a query in datasheet mode is all that you need and you don't care much about error issues, you should be OK. If you want finer control later, you probably want some kind of form.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
billgyrotech (07-15-2019)
Old 07-15-2019, 11:31 AM   #8
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 3,844
Thanks: 411
Thanked 687 Times in 666 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: Open Forms in Datasheet View (All Records)

According to this link http://www.utteraccess.com/forum/ope...-t1023173.html

you just specify the form view when opening?

DoCmd.OpenForm "frmEmails",acFormDS, stLinkCriteria

No query involved?

__________________
Access novice. Sometimes trying to give something back.
Access 2007


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
billgyrotech (07-15-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit Records Shown on Open in Datasheet View Lily Forms 2 05-16-2015 09:07 AM
open a form in datasheet view mana Forms 17 12-04-2014 11:22 PM
opening forms in Form view AND DataSheet view from a Switchboard tobypsl Forms 3 02-13-2013 01:42 PM
Forms in DataSheet View Kenln Modules & VBA 3 11-09-2006 12:12 PM
[SOLVED] Datasheet view in Forms Tunturi Forms 4 08-01-2004 02:02 AM




All times are GMT -8. The time now is 07:24 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World