B
Becky
I use the following code to filter a subform on my
form. I want to be able to preview the result in a report.
How do I change this to a tempQuery? Or is there a better
way to do this.
Private Sub cmdSearch_Click()
Dim strSQL As String
Dim strValue As String
If togAll Then
strSQL = "Select * from qrySchedule "
Else
strSQL = "Select * from qrySchedule Where [" & Me!
[cboField] & "] "
strValue = Trim(Nz(Me![txtValue]))
Select Case Me![cboSearchType]
Case 1: 'Search in the beginning
strSQL = strSQL & "Like '" & strValue & "*' "
Case 2: 'Search anywhere
strSQL = strSQL & "Like '*" & strValue
& "*' "
End Select
End If
Call fnSort(strSQL) 'Add the sort criteria and change
the recordsource
End Sub
Thanks,
Becky
form. I want to be able to preview the result in a report.
How do I change this to a tempQuery? Or is there a better
way to do this.
Private Sub cmdSearch_Click()
Dim strSQL As String
Dim strValue As String
If togAll Then
strSQL = "Select * from qrySchedule "
Else
strSQL = "Select * from qrySchedule Where [" & Me!
[cboField] & "] "
strValue = Trim(Nz(Me![txtValue]))
Select Case Me![cboSearchType]
Case 1: 'Search in the beginning
strSQL = strSQL & "Like '" & strValue & "*' "
Case 2: 'Search anywhere
strSQL = strSQL & "Like '*" & strValue
& "*' "
End Select
End If
Call fnSort(strSQL) 'Add the sort criteria and change
the recordsource
End Sub
Thanks,
Becky