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
 
Back
Top