Roman F
asked on
return the message if there are no records
I have a form with many buttons on it. One button has a simple query:
Select everything from TblMain where the RecDate =10/01/2019
if there are records they should open the results if there are no errors should be message box: there are no records
I need to create a macro
Select everything from TblMain where the RecDate =10/01/2019
if there are records they should open the results if there are no errors should be message box: there are no records
I need to create a macro
ASKER
i am confused a liitle bit...
Thank you for your response...
when you click on button you run the query...
if there are records you will the results otherwise the message box will inform you...
it should be thru the macro
Thank you for your response...
when you click on button you run the query...
if there are records you will the results otherwise the message box will inform you...
it should be thru the macro
You need macro ?
Sorry i only do VBA...much much better....is not that hard...just instead of doing "Macro Builder" you do "Event Builder"
Sorry i only do VBA...much much better....is not that hard...just instead of doing "Macro Builder" you do "Event Builder"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you, Gustav, if I need for example to set my filter instead of the date to something else like the status should be "Pending"...
Dim Filter As String
Filter = "[Status] = "Pending"", is the syntax is ok?
Dim Filter As String
Filter = "[Status] = "Pending"", is the syntax is ok?
The quotes would be slightly different:
Filter = "[Status] = 'Pending'"
ASKER
instead of using the table, may i use the query?
If DCount("*", qrySelection, Filter) = 0 Then
If DCount("*", qrySelection, Filter) = 0 Then
Perhaps. We don't have your query, but try.
ASKER
thank you
You are welcome!
Open in new window