S
Sierras
Hi
I have a continuous form and want to filter it with a a couple of unbound
combo boxes and a couple of unbound text boxes for the date range.
The user selects the filter criteria and then presses a filter button.
So far, I have managed to get the combo boxes to work but can't figure out
how to add the date range to the code.
This is what I have so far:
Private Sub Command40_Click()
Dim sFilter As String
sFilter = ""
If Not IsNull(ComboPatient) And ComboPatient <> 0 Then
sFilter = "[Patient] = """ & Me.ComboPatient & """"
End If
If Not IsNull(ComboProvider) And ComboProvider <> 0 Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Provider] = """ & Me.ComboProvider & """"
End If
If sFilter <> "" Then
Me.Filter = sFilter
Me.FilterOn = True
End If
End Sub
The unbound date text boxes are FromDate and ToDate and their getting
their data from a date field called DateOfService.
Anyone know how I could add this criteria to my code?
Thanks
I have a continuous form and want to filter it with a a couple of unbound
combo boxes and a couple of unbound text boxes for the date range.
The user selects the filter criteria and then presses a filter button.
So far, I have managed to get the combo boxes to work but can't figure out
how to add the date range to the code.
This is what I have so far:
Private Sub Command40_Click()
Dim sFilter As String
sFilter = ""
If Not IsNull(ComboPatient) And ComboPatient <> 0 Then
sFilter = "[Patient] = """ & Me.ComboPatient & """"
End If
If Not IsNull(ComboProvider) And ComboProvider <> 0 Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Provider] = """ & Me.ComboProvider & """"
End If
If sFilter <> "" Then
Me.Filter = sFilter
Me.FilterOn = True
End If
End Sub
The unbound date text boxes are FromDate and ToDate and their getting
their data from a date field called DateOfService.
Anyone know how I could add this criteria to my code?
Thanks