G
Guest
I've been through "Tim's" query and 69 Camaro's response for totalling the
number of records returned by a filter, but it didn't work for me. Perhaps my
situation is different enough (or I'm confused enough!) that someone can
advise how to do this.
First, I have a form based on a query that has some criteria specified, and
all these records are displayed in a subform.
The main form contains fields to allow the user to select multiple search
critiera, which are then passed to a filter. For example:
If Not IsNothing(cboOriginator) Then
If IsNothing(Searchstr) Then
Searchstr = "[OriginatorID]= " & Me.cboOriginator
Else
Searchstr = Searchstr & " AND [OriginatorID]= " & Me.cboOriginator
End If
End If
If Not IsNothing(cboProcess) Then
If IsNothing(Searchstr) Then
Searchstr = "[ProcessID]= " & Me.cboProcess
Else
Searchstr = Searchstr & " AND [ProcessID]= " & Me.cboProcess
End If
End If
Me.Searchstr = Searchstr
Me.Review_Search_subfrm2.Form.Filter = Searchstr
Me.Review_Search_subfrm2.Form.FilterOn = True
When the user clicks "Search" on the main form, the subform displays the
filtered records. If however, the search doesn't return any records, I want
to display a message box.
Like I said, I've tried 69 Camaro's solution, but it didn't work for me. Any
help will be greatly appreciated.
number of records returned by a filter, but it didn't work for me. Perhaps my
situation is different enough (or I'm confused enough!) that someone can
advise how to do this.
First, I have a form based on a query that has some criteria specified, and
all these records are displayed in a subform.
The main form contains fields to allow the user to select multiple search
critiera, which are then passed to a filter. For example:
If Not IsNothing(cboOriginator) Then
If IsNothing(Searchstr) Then
Searchstr = "[OriginatorID]= " & Me.cboOriginator
Else
Searchstr = Searchstr & " AND [OriginatorID]= " & Me.cboOriginator
End If
End If
If Not IsNothing(cboProcess) Then
If IsNothing(Searchstr) Then
Searchstr = "[ProcessID]= " & Me.cboProcess
Else
Searchstr = Searchstr & " AND [ProcessID]= " & Me.cboProcess
End If
End If
Me.Searchstr = Searchstr
Me.Review_Search_subfrm2.Form.Filter = Searchstr
Me.Review_Search_subfrm2.Form.FilterOn = True
When the user clicks "Search" on the main form, the subform displays the
filtered records. If however, the search doesn't return any records, I want
to display a message box.
Like I said, I've tried 69 Camaro's solution, but it didn't work for me. Any
help will be greatly appreciated.