C

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Table with fields USERNAME and CATEGORY. The same USERNAME may appear more
than once if it belongs to more than one category.

e.g.,
Bob, user
Bob, supervisor
Sue, user
Fred, user

Switchboard form has buttons (user, supervisor).

If Bob is the USERNAME, both the command buttons User and Supervisor should
be enabled. If Fred is the USERNAME, only the USer button is enabled.

I tried DLookup, but the function only looks at the first record (e.g., if
Bob is the USERNAME, only the category User is enabled). I want all buttons
for Bob to be enabled.
 
Are you using the built-in User-Level security? There are functions out
ther eto see if a user is in a certain group.
(Just one more reason NOT to use home-grown security).

Rick B
 
I would use DCount and more specific criteria for each test:

(air code)

Dim strCriteria as String

strCriteria = "USERNAME='Bob' AND LEVEL='supervisor'"
cmdSupervisor.Enabled = (DCount("*", "Permissions", strCriteria) > 0)

strCriteria = "USERNAME='Bob' AND LEVEL='user'"
cmdUser.Enabled = (DCount("*", "Permissions", strCriteria) > 0)

----
Of course, you wouldn't want to hard code Bob in there.


HTH,

Kevin
 

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