View Single Post
Old 07-15-2019, 08:16 AM   #2
Newly Registered User
Join Date: Apr 2015
Location: KY,USA
Posts: 3,378
Thanks: 0
Thanked 747 Times in 732 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.

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.
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)