Check if person hitting submit is in the user's table

J

JNariss

Hello,

I have created (almost finished) my database. I have a table called
Users which holds Full name, email address, user id, phone, manager and
analyst. The manager and analyst are checkbox (boolean) fields which
indicate if that user is a manager or analyst.

I have a form callled Approver Form. This a simple form with only a few
text boxes so the manager can go in and assign an analyst from my
listbox. It has fields of: Appraovers Name, Analyst Assigned, Analyst
EMail and Analyst Phone. On this form is a "submit" button which I have
programmed to Submit the Form to the database by adding a new record,
send an email to the Analyst to notify them they are the assigned
analyst, and a MsgBox which pops up telling the manager they have
notified the analyst.

I would like to somehow be able to check that the "Approvers Name" is a
manager in the users table. Is there a way to check this? And if the
person is not a manager then pop up a MsgBox stating they don't have
the ability to approve this form.

-Thanks,
Justine
 
G

George Nicholson

One approach:
If nz(DLookup("[Manager]","Users","[FullName] = '" & ApproversName &
"'"),0) = 0 Then
' Not authorized (Manager value is Null or False)
Else
' Authorized
End if

HTH,
 

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

Top