Find in Query Prompt

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

Guest

My form prompts for [Enter User Name] through the form's query. How do I
detect that a user does not exist from the prompt and send a "User Not Found"
error message?
 
Hi,
Create a table with all your users.
use dlookup to try and find the user.
if there then proceed. if not display message and exit sub.

IF IsNull(dlookup("[UserName]","UserNameTable","[UserName]
= ' " & me.NameTextbox & "'" then
Msgbox("User not found")
exit sub
else
your code
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