Return "No Matching Records"

S

slickdock

I have a form based on a query. When it opens, if the underlying query has no
records, I have a macro that conditionally uses DCount("*","frmCalendar1")=0
to successfully display the MsgBox "No Matching Records," then closes the
form.

Problem:
I have another form that is filtered by an underlying query PLUS an
additional filter name. How can I test for no matching records?

Thank you.
 
M

Mike Painter

slickdock said:
I have a form based on a query. When it opens, if the underlying
query has no records, I have a macro that conditionally uses
DCount("*","frmCalendar1")=0 to successfully display the MsgBox "No
Matching Records," then closes the form.

Problem:
I have another form that is filtered by an underlying query PLUS an
additional filter name. How can I test for no matching records?

Thank you.

DCount("*","frmCalendar1", " Something = [ThisRecords] AND some other
criteria.")

I'm assuming the macro can handle conditions, if not switch to code.
 
S

slickdock

The problem is I don't know what the second "something" might be. Maybe the
user will have filtered by selection, or filter excluding selection. How can
I add the form's current filter property to the dcount expression?

Mike Painter said:
slickdock said:
I have a form based on a query. When it opens, if the underlying
query has no records, I have a macro that conditionally uses
DCount("*","frmCalendar1")=0 to successfully display the MsgBox "No
Matching Records," then closes the form.

Problem:
I have another form that is filtered by an underlying query PLUS an
additional filter name. How can I test for no matching records?

Thank you.

DCount("*","frmCalendar1", " Something = [ThisRecords] AND some other
criteria.")

I'm assuming the macro can handle conditions, if not switch to code.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top