How do I verify a user before a form opens.

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

Guest

Hi,
I have a database that access people by a number I assign to them. I have a
query that asks for it in the criteria column. However, if I enter a wrong
number, the form will still open up, just without their data at the top. Is
there a way to verify the user before the form opens up? Thanks in advance
to anyone that can help.
 
Hi,
I have a database that access people by a number I assign to them. I have a
query that asks for it in the criteria column. However, if I enter a wrong
number, the form will still open up, just without their data at the top. Is
there a way to verify the user before the form opens up? Thanks in advance
to anyone that can help.

You can code the Form's Open event to cancel the form opening, but you
haven't given enough detail for me to accurately code this.
Adapt the following:

If [SomeValue] = UserID then
Else
Cancel = True
End If
 
I imagined it might be something along those lines, thanks. Here's a
question for you though, If I am starting on my homepage form, and then
hitting a button to get the pop-up, asking for the employee, and then
proceeding to the next form, where would I find the code for that pop-up? I
hope it makes sense the way I'm asking, but if not, please let me know and I
will try to rephrase. Thanks for the response.

fredg said:
Hi,
I have a database that access people by a number I assign to them. I have a
query that asks for it in the criteria column. However, if I enter a wrong
number, the form will still open up, just without their data at the top. Is
there a way to verify the user before the form opens up? Thanks in advance
to anyone that can help.

You can code the Form's Open event to cancel the form opening, but you
haven't given enough detail for me to accurately code this.
Adapt the following:

If [SomeValue] = UserID then
Else
Cancel = True
End If
 
Alright, I figured out where it was, that wasn't too hard. Next step is, the
verifying info is held in a table named "Employee" and the verifying field is
called "AdjudicatorID" , if the variable being taken in is called
"stDocName", how would I code that? Would it be something like

If stDocName = .Employee.AdjuicatorID Then

Just not sure how to access the proper area, thanks.

Nick said:
I imagined it might be something along those lines, thanks. Here's a
question for you though, If I am starting on my homepage form, and then
hitting a button to get the pop-up, asking for the employee, and then
proceeding to the next form, where would I find the code for that pop-up? I
hope it makes sense the way I'm asking, but if not, please let me know and I
will try to rephrase. Thanks for the response.

fredg said:
Hi,
I have a database that access people by a number I assign to them. I have a
query that asks for it in the criteria column. However, if I enter a wrong
number, the form will still open up, just without their data at the top. Is
there a way to verify the user before the form opens up? Thanks in advance
to anyone that can help.

You can code the Form's Open event to cancel the form opening, but you
haven't given enough detail for me to accurately code this.
Adapt the following:

If [SomeValue] = UserID then
Else
Cancel = True
End If
 

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