Hello,
So, I have a form with buttons and a text box for different reports. One "report" is a form that opens in datasheet mode to show activity logs for the day (phone calls, staff activities, etc). I want it to where they can select a date in txtDate on the form and click a button to open the datasheet and filter it based on the date in txtDate.
This code works for filtering it to todays date. What I can't figure out is how to change date() to txtDate's value. txtDate is unbound and formatted as short date.
Bonus points if you could also tell me how to filter it based on two text boxes for start and end dates.
Also, I have a checkbox, patientdeceased, that I would like to add to the where statement possibly where patientdeceased = false. Multiple where conditions always jack me up.
So, I have a form with buttons and a text box for different reports. One "report" is a form that opens in datasheet mode to show activity logs for the day (phone calls, staff activities, etc). I want it to where they can select a date in txtDate on the form and click a button to open the datasheet and filter it based on the date in txtDate.
Code:
Private Sub cmdActivityLogDaily_Click()
Dim strCaption As String
strCaption = "Today's Activity Log"
DoCmd.OpenForm "ActivityLogQReport", acFormDS, , "CallDate= date()", , , strCaption
End Sub
This code works for filtering it to todays date. What I can't figure out is how to change date() to txtDate's value. txtDate is unbound and formatted as short date.
Bonus points if you could also tell me how to filter it based on two text boxes for start and end dates.
Also, I have a checkbox, patientdeceased, that I would like to add to the where statement possibly where patientdeceased = false. Multiple where conditions always jack me up.
Last edited: