Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form opens blank when no record

Status
Not open for further replies.
Jul 27, 2004
52
0
0
US
Can't believe i'm asking this...
I have a master form. I have a control which the user clicks and it prompts them to enter a "Customer Number". When they enter the number and click ok it opens the Master form to that record and all corresponding data.
The thing is this. Sometimes user error occurs *imagine that* and a user enters an invalid customer number. The form opens anyway, but all fields are blank.
Isn't there a way that I can have a message pop up if the customer number does not exist? I'm sure there is.

Thanks much!
 
After the user has entered a number, you could do a DLookup to confirm that the number exists - open the form if it does, reprompt if it doesn't.

Hope this helps.
 
Or you may consider a combo for the "Customer Number" retrieval.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you use a combobox as PHV suggests, don't forget that LimitToList should be set to True to prevent the user from typing in a non-existent number.

Hope this helps.
 
You can also create a quick recordset using the same criteria. If .recordcount >0 then open the form, else....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top