here's a copy of the DB
FYI
The two txt boxes there (which might be blank yourside) gather the user name and access level
The listbox contains a link to the form/report depending on the user level
here's a copy of the DB
FYI
The two txt boxes there (which might be blank yourside) gather the user name and access level
The listbox contains a link to the form/report depending on the user level
It grabbed my system id and of course assigned level 1. There aren't any item 1's in lstMenu so I had nothing to select. Added my ID as Admin in tblStaff.
I changed the event to AfterUpdate. Works great.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
yeah it works fine
Think your able to help me with the amendments?
I just want the restricted users to have access to ASE_Units_form. And within the form I want them only to be able to edit/have access to the:
Location
DBA
SiteName
DateInstalled
and Repair History (subform)
The rest need to be locked.
Amendments of what to what? Are you talking about buttons instead of the listbox?
Oh, you must mean the limitations on the ASE_Units_form.
Use that form's Open event and set Visibility or Enabled property.
Code:Select Case iAccess Case 1 Me.controlname1.Enabled = False Me.controlname2.Enabled = False ... Case 2 'something here? Case 3 'do nothing, full rights End Select
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
ok i'll try that. Thanks
Yes i meant the buttons instead of the listbox as well.
Hey June!
The coding you gave me worked great for the buttons on the Main_Menu.
The tried using the same code in the ASE_Units_form to disable some of the fields in there (open event). I couldn't get it to work. Can the coding be used for buttons and Fields?
Want the code to work for a "code 2" user
Yes, can use code on buttons and data controls.
It isn't working because turns out iAccess is a local variable. That means it has a life only in the Load procedure of Main_Menu where it is declared. When the procedure completes the variable is dropped from memory. I did ask some time ago what iAccess is. So, my suggestion (and what I use) is to set a textbox on Main_Menu to the permissions value. Main_Menu remains open at all times so the value is always available for reference.
Add this line into the header of all modules (just below Option Compare Database): Option Explicit. This will demand that all variables be declared somewhere with a Dim statement. It will help in debugging issues like this.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
sorry, I didnt know it was local
I get what your saying. but how do i do that exactly? or can you send the attachment over? This DB has been given me a headache for the past few days. Thanks for your help and patience
You seem to already have a textbox on Main_Menu and the code in load event to populate. Now refer to that textbox in place of iAccess in the ASU_Units form code: Forms!Main_Menu.txtLevel
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.