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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Query problems?

Status
Not open for further replies.

JimUK

Technical User
Jan 1, 2001
57
US
I am using a simple Select Query where I am trying to find a particular (text field) record, which is not a problem. The problem is that I do not want to view the form that the query is calling if there is no matches. A blank form shows up now. I tried a macro that will bring up a msg box if the field is null or rather empty string but when would I run this? It actually needs to run when the query does. Anybody steer me in the right direction?

Thanks,

Jim Norris
 
In the On_current event of the form
put this which is similar to your same macro expression

If IsNull(Myfield) Then
DoCmd.Close
End If

that should close the form before it opens
Or where ever you call the form from. DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
Or visit my WEB site
 
On the same vein could I then run a macro "On Close" that would pop up a Msg Box saying that record was not found?

Thanks,

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top