mraetrudeaujr
Technical User
I'm taking the advice of the many experts in this forum, and I'm weaning myself off of using MACROS. So, I searched the FAQ's on this forum for a way to 'code' the command buttons to search various fields. I found the following example:
This code looks like I can modify it for my database, so how I would set this code up? On the 'On Click' event, and change the "PolInsured" to my particular field?
If I'm missing something, please show me what I need to accomplish this 'search/find' command button creation on my forms. Thank you.
Al
Code:
Dim rst As Recordset
Dim strSearchName As String
Set rst = Me.RecordsetClone
strSearchName = Me.txtSearch
rst.FindFirst "PolInsured Like '*" & Nz(strSearchName, "") & "*'"
If rst.NoMatch Then
MsgBox "Record not found"
Else
Me.Bookmark = rst.Bookmark
End If
rst.Close
This code looks like I can modify it for my database, so how I would set this code up? On the 'On Click' event, and change the "PolInsured" to my particular field?
If I'm missing something, please show me what I need to accomplish this 'search/find' command button creation on my forms. Thank you.
Al