I have a form with a query subform on it and two unbound text boxes.
The goal is to add command buttons each filtering the date Between user input in unbound text boxes and between a specific disability. would be a command button for each of the disabilities we recognize.
The query has several specific fields from the main table: Participant ID, Participant Name, Application Date, Disability Primary.
it allows me to organize my caseload, based on the number of applications in a date range and various different disabilities we used to find someone eligible for service.
I have a code snippet that will filter Between two dates (From and To) based on user added input in the text boxes on the form.
I have another code snippet that will filter by specific disability using Like. e.g Like Cognitive*, Like Physical*, Like Psychosocial* etc.
these both work well individually, but i would like to get them into one snippet of code that would allow me to filter by date, and then by primary disabilities within that date range.
can anybody offer any advice, i am not a programmer, just picking this up from looking at other people's examples.
heres the code:
filter that works on date: (would ultimately like this command button to filter date and then find cognitive disability within that date range)
Private Sub Cognitive_Click()
Dim strFilter As String
strFilter = "([Application Date] Between #" & Me.txtFromDate & "# And #" & Me.txtToDate & "#)"
Me.DisabilityList.Form.Filter = strFilter
Me.DisabilityList.Form.FilterOn = True
End Sub
filter that works on text using Like:
Private Sub psychosocial_Click()
Dim strFilterText As String
strFilterText = "([Disability Primary] Like 'psycho*')"
Me.DisabilityList.Form.Filter = strFilterText
Me.DisabilityList.Form.FilterOn = True
End Sub