Hi:
I have a pop up form based on a query.
I am openings the form, and wish to close it immediately if the query has result.
My method is to put a macro in the "on Open" event , which has the following code
IsNull([date]) Close (the form I just opened)
Date is one of the fields in the form.
If the date is null, its supposed to trigger a closing of the form. Unfortunately, what
happens is a blank form appears. I have tried IsEmpty and various other formulations with
no joy! The same thing happens if I use the "Load" or "On Open" events, so I am a bit
perplexed.
If the query DOES have a result, the form appears as it should and the fields are entered.
Can anyone suggest what I should be doing? Is there a proper way to determine if a form
(or a query) is empty?
Best and thanks
John Baker
I have a pop up form based on a query.
I am openings the form, and wish to close it immediately if the query has result.
My method is to put a macro in the "on Open" event , which has the following code
IsNull([date]) Close (the form I just opened)
Date is one of the fields in the form.
If the date is null, its supposed to trigger a closing of the form. Unfortunately, what
happens is a blank form appears. I have tried IsEmpty and various other formulations with
no joy! The same thing happens if I use the "Load" or "On Open" events, so I am a bit
perplexed.
If the query DOES have a result, the form appears as it should and the fields are entered.
Can anyone suggest what I should be doing? Is there a proper way to determine if a form
(or a query) is empty?
Best and thanks
John Baker
Comment