M
Ment@lBl0ck
From a form we are finding a customer, we use like for a wildcard option;
When we enter a seach string, for example "mich*" - it will seach for
michael, michelle etc... If no match is found it creates a new record....
What we want is to do is display a message if no match is found and NOT to
create a new record.
Have limited code experience, this is what was created by the wizard and
then added to for the wildcard searching.
Code
Private Sub viaPhone_Click()
On Error GoTo Err_viaPhone_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Customer"
stLinkCriteria = "[Phone] LIKE " & "'" & Me![FindCustomer] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_viaPhone_Click:
Exit Sub
Err_viaPhone_Click:
MsgBox Err.Description
Resume Exit_viaPhone_Click
When we enter a seach string, for example "mich*" - it will seach for
michael, michelle etc... If no match is found it creates a new record....
What we want is to do is display a message if no match is found and NOT to
create a new record.
Have limited code experience, this is what was created by the wizard and
then added to for the wildcard searching.
Code
Private Sub viaPhone_Click()
On Error GoTo Err_viaPhone_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Customer"
stLinkCriteria = "[Phone] LIKE " & "'" & Me![FindCustomer] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_viaPhone_Click:
Exit Sub
Err_viaPhone_Click:
MsgBox Err.Description
Resume Exit_viaPhone_Click