If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Turn off command buttons if a manager doesn't have accounts
I have a form where users first login and get a UserID.
I have a table with accounts and the accounts are assigned to the users. I have a relationship between tblAccounts and tlbUser (UserID). The next form is the main form and I would like certain controls to disappear if the user does NOT have any accounts assigned to him (ie. Sales supervisor). Right now I have it setup where the form checks if that specific UserID is logged in and turns them off accordingly. But pretty soon others without accounts will be able to log in (ie. Purchasers, Customer Reps, Engineers) so this will become inefficient really quickly. How would I do this? -- TIA |
#2
|
|||
|
|||
Turn off command buttons if a manager doesn't have accounts
In the form Load event, do a DLookup to see if the user has any accounts
assigned and set the visibility property of the controls as needed. Do the DLookup on the field that carries the user name. -- Dave Hargis, Microsoft Access MVP "tsison7" wrote: I have a form where users first login and get a UserID. I have a table with accounts and the accounts are assigned to the users. I have a relationship between tblAccounts and tlbUser (UserID). The next form is the main form and I would like certain controls to disappear if the user does NOT have any accounts assigned to him (ie. Sales supervisor). Right now I have it setup where the form checks if that specific UserID is logged in and turns them off accordingly. But pretty soon others without accounts will be able to log in (ie. Purchasers, Customer Reps, Engineers) so this will become inefficient really quickly. How would I do this? -- TIA |
Thread Tools | |
Display Modes | |
|
|