G
Guest
I set up a search form with 3 text boxes and 3 apply filter buttons and a
clear filter button. all these buttons worked, and i saved the database.
however, when i pulled the form back up, the buttons stopped working. I dont
think it is a coding error since it worked before, but here's the codes for
my buttons:
FOR ONE SEARCH
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterSIC) Then
strWhere = strWhere & "([SIC] LIKE """ & Me.txtFilterSIC & "*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
FOR THE 2ND SEARCH BUTTON
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterDesc) Then
strWhere = strWhere & "([Description] Like ""*" & Me.txtFilterDesc &
"*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
3rd search
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterIndustry) Then
strWhere = strWhere & "([Industry] Like ""*" & Me.txtFilterIndustry
& "*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
Lastly, the clear filter button
On Error GoTo Err_Command51_Click
Dim stDocName As String
stDocName = "ClearFilter"
DoCmd.RunMacro stDocName
Me.txtFilterSIC = Null
Me.txtFilterDesc = Null
Me.txtFilterIndustry = Null
Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command51_Click
These 4 codes are defined for 4 diff buttons, they just dont work anymore!
Help!
clear filter button. all these buttons worked, and i saved the database.
however, when i pulled the form back up, the buttons stopped working. I dont
think it is a coding error since it worked before, but here's the codes for
my buttons:
FOR ONE SEARCH
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterSIC) Then
strWhere = strWhere & "([SIC] LIKE """ & Me.txtFilterSIC & "*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
FOR THE 2ND SEARCH BUTTON
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterDesc) Then
strWhere = strWhere & "([Description] Like ""*" & Me.txtFilterDesc &
"*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
3rd search
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilterIndustry) Then
strWhere = strWhere & "([Industry] Like ""*" & Me.txtFilterIndustry
& "*"")"
Me.Filter = strWhere
Me.FilterOn = True
End If
Lastly, the clear filter button
On Error GoTo Err_Command51_Click
Dim stDocName As String
stDocName = "ClearFilter"
DoCmd.RunMacro stDocName
Me.txtFilterSIC = Null
Me.txtFilterDesc = Null
Me.txtFilterIndustry = Null
Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command51_Click
These 4 codes are defined for 4 diff buttons, they just dont work anymore!
Help!