Hi
I have very limited VBA knowledge. With the following code it works perfectly when clicking a search button but comes up as "No Match" when I run it as a combobox value change. Any ideas please
Search
Change
I have very limited VBA knowledge. With the following code it works perfectly when clicking a search button but comes up as "No Match" when I run it as a combobox value change. Any ideas please
Search
Code:
Private Sub cmdSearch_Click()
Dim bkmk As Variant
Dim strField As String
Me.RecordsetClone.MoveFirst
'Find the first record that matches what
'is in the search text box.
Me.RecordsetClone.FindFirst "Variety Like" _
& Chr(34) & Me.txtSearch & "*" & Chr(34)
If Me.RecordsetClone.NoMatch Then
MsgBox "No Match"
Else
bkmk = Me.RecordsetClone.Bookmark
Me.Recordset.Bookmark = bkmk
End If
End Sub
Change
Code:
Private Sub cboVariety_Change()
Dim bkmk As Variant
Dim strField As String
Me.RecordsetClone.MoveFirst
'Find the first record that matches what
'is in the search text box.
Me.RecordsetClone.FindFirst "Variety Like" _
& Chr(34) & Me.cboVariety & "*" & Chr(34)
If Me.RecordsetClone.NoMatch Then
MsgBox "No Match"
Else
bkmk = Me.RecordsetClone.Bookmark
Me.Recordset.Bookmark = bkmk
End If
End Sub