Hello everybody,
I have a continuous form of customers and at the top I have a combo box where I can select any of them and then press button "Show details"
I created this code:
Code:
Private Sub Command15_Click()
Dim ChosenCustomer As String
If IsNull(cboCustomer) Then
MsgBox ("You need to choose a customer from the list.")
Else
ChosenCustomer = cboCustomer
DoCmd.Close acForm, "frmCustomersOverview", acSavePrompt
DoCmd.OpenForm "frmCustomerCard", , , "[CustomerName]=" & ChosenCustomer
End If
End Sub
I choose, let's say, customer "Smith" from the list and hit the button.
I get this error: Run-time error '3075': Syntax error (missing operator) in query expression: [CustomerName]=Smith.
Can anyone help me here? What am I doing wrong?
Thank you,
Tomas