R
Ryan Tisserand
Access 2003
Windows Vista Business
Form Name - C25Transactions
Subform Name - C25Transactions subform
Filter Name - Filter
Filter Field Name - CheckFilter
When I click the filter button on the main form I want to filter the data on
the subform by the Check# Field. Here is my current code that I cant seem to
get to work. Please help by correcting my code.
Private Sub Filter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.CheckFilter) Then
strWhere = strWhere & "(Me![C25Transactions_subform].Form![Check#]= " &
Me.CheckFilter & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Please enter at least one Search Criteria", vbInformation,
"Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Debug.Print strWhere
Me.C25Transactions_subform.Form.Filter = strWhere
Me.C25Transactions_subform.Form.Filter = True
End If
Me.C25Transactions_subform.Form.Filter = strWhere
Me.C25Transactions_subform.Form.Filter = True
End Sub
Windows Vista Business
Form Name - C25Transactions
Subform Name - C25Transactions subform
Filter Name - Filter
Filter Field Name - CheckFilter
When I click the filter button on the main form I want to filter the data on
the subform by the Check# Field. Here is my current code that I cant seem to
get to work. Please help by correcting my code.
Private Sub Filter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.CheckFilter) Then
strWhere = strWhere & "(Me![C25Transactions_subform].Form![Check#]= " &
Me.CheckFilter & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Please enter at least one Search Criteria", vbInformation,
"Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Debug.Print strWhere
Me.C25Transactions_subform.Form.Filter = strWhere
Me.C25Transactions_subform.Form.Filter = True
End If
Me.C25Transactions_subform.Form.Filter = strWhere
Me.C25Transactions_subform.Form.Filter = True
End Sub