Carina1628
Technical User
Hi all-
I have searched for an answer in this site, but can't find a similar problem.
I have a large database that was created with the name field as "Last, first". Unfortunately, with the diversity of entries, I can't split this field out.
I want to be able to pull up all the records with a last name similar to the one typed in a pop-up box. It worked with Deed#'s, but that was an exact match.
Here is the code I have:
Private Sub cmdMatchingNames_Click()
On Error GoTo Err_cmdMatchingNames_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DataEntryFilterName"
stLinkCriteria = "Owner =" & "'" & Me![OwnerName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdMatchingNames_Click:
Exit Sub
Err_cmdMatchingNames_Click:
MsgBox Err.Description
Resume Exit_cmdMatchingNames_Click
End Sub
[OwnerName] is the field on the popup, [Owner] is the field I am searching in. I have tried using "Like" and wildcards, but I am not getting them in the right spot.
Can anyone help?
Much Appreciation,
Carina
I have searched for an answer in this site, but can't find a similar problem.
I have a large database that was created with the name field as "Last, first". Unfortunately, with the diversity of entries, I can't split this field out.
I want to be able to pull up all the records with a last name similar to the one typed in a pop-up box. It worked with Deed#'s, but that was an exact match.
Here is the code I have:
Private Sub cmdMatchingNames_Click()
On Error GoTo Err_cmdMatchingNames_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DataEntryFilterName"
stLinkCriteria = "Owner =" & "'" & Me![OwnerName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdMatchingNames_Click:
Exit Sub
Err_cmdMatchingNames_Click:
MsgBox Err.Description
Resume Exit_cmdMatchingNames_Click
End Sub
[OwnerName] is the field on the popup, [Owner] is the field I am searching in. I have tried using "Like" and wildcards, but I am not getting them in the right spot.
Can anyone help?
Much Appreciation,
Carina