gold007eye
Registered User.
- Local time
- Yesterday, 21:20
- Joined
- May 11, 2005
- Messages
- 260
I am trying to set the RecordSource of a List in the OnOpen even of the form based on the text box "Last Name" that is filled in by the user on the Main Menu. For some reason I can't get the code to work with the "LIKE" command what am I doing wrong?
I am getting Data Mis-Match 13. How can I get the Like portion of the code to work correctly? If I remove the "Like" portion and change it to "=" then I get know errors. I'm lost at what to do next.
I am getting Data Mis-Match 13. How can I get the Like portion of the code to work correctly? If I remove the "Like" portion and change it to "=" then I get know errors. I'm lost at what to do next.
Code:
Private Sub Form_Open(Cancel As Integer)
Me![Search Results].RowSource = _
"SELECT [Letter Information].[Provider Name], [Letter Information].[Contact Name], [Letter Information].[Letter Type], [Letter Information].[Letter Date], [Letter Information].Analyst, [Letter Information].[Address Line 1], [Letter Information].[Address Line 2], [Letter Information].City, [Letter Information].State, [Letter Information].[Zip Code]" & _
"From [Letter Information]" & _
"WHERE ((([Letter Information].[Provider Name]) Like " * " & [Forms]![Main Menu]![Last Name])" & _
"ORDER BY [Letter Information].[Provider Name];"
End Sub