Been a while since I've used VBA in Access!!
I currently have a form (frmKeys) that has the following sections:
======================
Find Keys
[Live/Test] [Software] - Both combo boxes
[Bit Rate] [Version] - Both combo boxes
[FIND] [CLEAR]
======================
Keys
[Keys] - Subform
[Notes]
======================
Add Keys
[Live/Test] [Software] - Both combo boxes
[Bit Rate] [Version] - Both combo boxes
======================
I've got the add sections working, but am having problems with the code for the 'FIND' section!
I'm trying to get the code to filter the form based on the user's choice in the top four combo boxes.
Here's the code I'm using (failing to, I should say. LOL!):
Code:
Private Sub btnFind_Click()
Dim strFilter As String
If Not IsNull(Me.cboLive) Then
strFilter = strFilter & " And Live/Test = " & Me.cboLive
End If
If Not IsNull(Me.cboBit) Then
strFilter = strFilter & " And 32/64bit = " & Me.cboBit
End If
If Not IsNull(Me.cboSoftware) Then
strFilter = strFilter & " And Software = " & Me.cboSoftware
End If
If Not IsNull(Me.cboVersion) Then
strFilter = strFilter & " And Version = " & Me.cboVersion
End If
' remove redundant leading " And " from filter expression
strFilter = Mid(strFilter, 6)
' filter form
Me.Filter = strFilter
Me.FilterOn = True
End Sub
When I click the Find button, all I get is an error and debugging points me to the line:
Code:
Me.Filter = strFilter
Anybody able to point out where I've gone wrong?
Please let me know what info I can give to clarify further!