Search Resulting in a Blank Form

Hustle1081

Registered User.
Local time
Today, 00:10
Joined
Jan 8, 2004
Messages
16
I have created a Database that includes a search engine that allows a user to search for 20 seperate categories and for each category they search simultaneously the result will have everything they searched for. I have set up the form which results to display this information using combo boxes, and the form does not display the new record (blank record). Now my problem is That when I run the search and there are no matching results the form comes up blank. There is absolutely nothing on the form but the form still opens. What I would like it to do is display a message box and when you click on OK on the message box I would like it to reopen the search and close (or never even open) the blank form that it usually displays. What I really need help on is how to check for this blank form. If there is a way to check for the blank form or someone knows another way of doing this I would appreciate it if you could help me out. If anyone needs to see the database or just needs more specific information please let me know and I will do what I can to clarify.
 
Put an IF IsNul loop in your code to display a msgbox.Then, when you close the Msgbox, you can use that event to refire the search engine.
 
If IsNul loop would prob be the way to go but would I put the IsNul for the form. I dont know what to check for in order to use the IsNul statement.
 
Hustle1081 said:
If IsNul loop would prob be the way to go but would I put the IsNul for the form. I dont know what to check for in order to use the IsNul statement.

Ok easy way.

Is there any one control on your form that is always poulated if there is any record to display?

I.e. A record ID field is always a good one.

If this is the case then use this field for your If IsNul loop

your code would go somthing like


If IsNull(Me![Mycontrol]) Then
MsgBox "That dosn't work.", vbCritical
Else

Then use the onclick event behind the ok button on the MsgBox that pops up to re run the search.

If there is an entry in MyControl the If IsNul loop will skip and continue to the rest of the code.

Dose this help
 
Ill try it and I will let you know thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom