I wish to create a form which will enable someone to type in a name, search for that name in the database and display that record on another form. So far I've been able to use the 'form operation' command button, but unless what's been type in is the exact match, it won't bring up the record. Is there a way to somehow modify this code so that I will be able to bring up a record based on a partial match?
Private Sub Search_Click()
On Error GoTo Err_Search_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Client"
stLinkCriteria = "[AccName]= " & "'" & Me![AccName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Search_Click:
Exit Sub
Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click
End Sub
Any help would be appreciated.
Private Sub Search_Click()
On Error GoTo Err_Search_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Client"
stLinkCriteria = "[AccName]= " & "'" & Me![AccName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Search_Click:
Exit Sub
Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click
End Sub
Any help would be appreciated.