Hi there. I'm trying to create a search form that has six fields to search. I have created an option group with the 6 fields I would like users to be able to search by. The idea that they select an option, enter the data into the textbox and then hit search and it should display the results below.......
Private Sub Command15_Click()
Dim sOption As String
Select Case Me.Frame16
Case 1
sOption = "Reference Number"
Case 2
sOption = "Pallet / Tray Number"
Case 3
sOption = "Date Logged"
Case 4
sOption = "Week"
Case 5
sOption = "Rack Location"
Case 6
sOption = "Description"
End Select
If IsNull(Text12) = False Then
Me.Recordset.FindFirst "[Frame16]=" & Text12
Me!Text12 = Null
If Me.Recordset.NoMatch Then
MsgBox "No Record Found!", vbOKOnly + vbInformation, "Search Record"
Me!Text12 = Null
End If
End If
End Sub
Problem is that when I hit search it just returns the message box saying "No Records Found" every time. Guessing that it isn't using the option buttons properly somehow but I'm pretty new to vba and I'm struggling to figure out where I'm going wrong. Anyone able to see the problem?