I have a form that uses combo boxes to enter data. When there is a change in the customer name combo box, I want to search to see if the customer exists, and fill in their customer number to the appropriate area so that I dont allways have to look it up from a printed list. This is my sub
Private Sub cbcustomer_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "Customer_Name = " & [cbcustomer].Value
If rs.NoMatch = False Then
Me.Bookmark = rs.Bookmark
[cbcustid].Value = Customer.Cust_ID
End If
rs.Close
End Sub
I am getting the run time error 3077 "Syntax error (missing operator) in expression" The debugger highlights my rs.FindFirst "Customer_Name = " & [cbcustomer].Value line in yellow. I use this same syntax to perform a similar search in a different form. I'm not sure why it is not working here. Is there anything that stands out as wrong in the sub? I have been hypnotized by the same line since lunch.
Private Sub cbcustomer_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "Customer_Name = " & [cbcustomer].Value
If rs.NoMatch = False Then
Me.Bookmark = rs.Bookmark
[cbcustid].Value = Customer.Cust_ID
End If
rs.Close
End Sub
I am getting the run time error 3077 "Syntax error (missing operator) in expression" The debugger highlights my rs.FindFirst "Customer_Name = " & [cbcustomer].Value line in yellow. I use this same syntax to perform a similar search in a different form. I'm not sure why it is not working here. Is there anything that stands out as wrong in the sub? I have been hypnotized by the same line since lunch.