P
PJ
I have a main Search Criteria Form with a SubForm with the following coding
is a command button on the main form:
Private Sub Command62_Click()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yy#\"
If Not IsNull(Me.Issuer) Then
strWhere = strWhere & "([Issuer] = """ & Me.Issuer & """) AND "
End If
If Not IsNull(Me.StartDate) Then
strWhere = strWhere & "([Launch]>= " & Format(Me.StartDate,
conJetDate) & ") And "
End If
If Not IsNull(Me.EndDate) Then
strWhere = strWhere & "([Launch]<= " & Format(Me.EndDate,
conJetDate) & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then 'Nah: there was nothing in the string.
MsgBox "No criteria", vbInformation, "Nothing to do."
Else 'Yep: there is something there, so remove the "
AND " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging, remove the leading quote on the next line. Prints to
Immediate Window (Ctrl+G).
'Debug.Print strWhere
'Finally, apply the string as the form's Filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
When I click the Search button it shows at the bottom how many filtered but
I am trying to get it to output to results to the subform named
"frmSearchFunction"
Any ideas??
Thanks in advance.
is a command button on the main form:
Private Sub Command62_Click()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yy#\"
If Not IsNull(Me.Issuer) Then
strWhere = strWhere & "([Issuer] = """ & Me.Issuer & """) AND "
End If
If Not IsNull(Me.StartDate) Then
strWhere = strWhere & "([Launch]>= " & Format(Me.StartDate,
conJetDate) & ") And "
End If
If Not IsNull(Me.EndDate) Then
strWhere = strWhere & "([Launch]<= " & Format(Me.EndDate,
conJetDate) & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then 'Nah: there was nothing in the string.
MsgBox "No criteria", vbInformation, "Nothing to do."
Else 'Yep: there is something there, so remove the "
AND " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging, remove the leading quote on the next line. Prints to
Immediate Window (Ctrl+G).
'Debug.Print strWhere
'Finally, apply the string as the form's Filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
When I click the Search button it shows at the bottom how many filtered but
I am trying to get it to output to results to the subform named
"frmSearchFunction"
Any ideas??
Thanks in advance.