A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old January 7th, 2008, 07:15 PM posted to microsoft.public.access.forms
tsison7
external usenet poster
 
Posts: 69
Default 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  
Old January 7th, 2008, 07:40 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.