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

  • Thread starter Thread starter tsison7
  • Start date Start date
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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top