caykamanj1966
Technical User
All, I have a report (rpt_Expenses) with these 2 fields: [date] and [purpose]
I want to create a button on a form to bring up the report, but before it opens I want to search for a date range, for the [date] field, and I want to search a value from the [purpose] field.
I found code from dhookom, which is below:
Dim strWhere As String
strWhere = "[purpose] = """ & Me.purpose & """"
DoCmd.OpenReport "rpt_ExpRpt", acViewPreview, , strWhere
I just need to know how to incorporate searching for a date range, to include in the code.
Also, is the above correct for the [purpose] field?
Your help will be greatly appreciated.
I want to create a button on a form to bring up the report, but before it opens I want to search for a date range, for the [date] field, and I want to search a value from the [purpose] field.
I found code from dhookom, which is below:
Dim strWhere As String
strWhere = "[purpose] = """ & Me.purpose & """"
DoCmd.OpenReport "rpt_ExpRpt", acViewPreview, , strWhere
I just need to know how to incorporate searching for a date range, to include in the code.
Also, is the above correct for the [purpose] field?
Your help will be greatly appreciated.