Turn off command buttons if a manager doesn't have accounts

T

tsison7

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?
 
K

Klatuu

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