Hello I am new to MS Access but I am learning, I pick up quick.
My question is can you use a wildcard search when looking for a recordset on a continuous form thats attached to a table? I know i probly should be creating a Quary then searching then pulling that information up but i was unsure how to do that.
Heres what i have done so far
There is a textbox called SearchField that the user can enter something in
There is a search button, once the user hits the search it runs the following code:
Private Sub Search_Click()
Me.Form.RecordsetClone.FindFirst "PN = '" & Me.SearchField.Value & "'"
If Not Me.Form.RecordsetClone.NoMatch Then
Me.Form.Bookmark = Me.Form.RecordsetClone.Bookmark
Else
MsgBox " Part number not found"
End If
End Sub
This code works (Searches for what is in the SearchField textbox and looks for it in the PN collumn of the table, then it will select it if it exists) This ONLY works if the PN is exactly how you type it in however I would like it if you could type 15* and it would find anything that starts with 15.
Please help.
My question is can you use a wildcard search when looking for a recordset on a continuous form thats attached to a table? I know i probly should be creating a Quary then searching then pulling that information up but i was unsure how to do that.
Heres what i have done so far
There is a textbox called SearchField that the user can enter something in
There is a search button, once the user hits the search it runs the following code:
Private Sub Search_Click()
Me.Form.RecordsetClone.FindFirst "PN = '" & Me.SearchField.Value & "'"
If Not Me.Form.RecordsetClone.NoMatch Then
Me.Form.Bookmark = Me.Form.RecordsetClone.Bookmark
Else
MsgBox " Part number not found"
End If
End Sub
This code works (Searches for what is in the SearchField textbox and looks for it in the PN collumn of the table, then it will select it if it exists) This ONLY works if the PN is exactly how you type it in however I would like it if you could type 15* and it would find anything that starts with 15.
Please help.