G
Guest
I'm sure I'm doing something really stupid, please help me figure it out. I
hope I explain it clear enough.
I have a form with a combo box that lets you select which client record you
want to go to. The name of this combo box is cmb_SelectClient.
There is also a check box called Former on the form.
I also have a query called qry_Former_Clients which joins 2 tables
tbl_SupportClients, tbl_AllClients. This gives me all the clients in hte
tbl_SupportClient table and the matching clients in the tbl_AllClients. For
Example:
tbl_SupportClients.Client tbl_AllClients.CompanyName
Client01 CompanyName01
Client02 CompanyName02
Client03 Null
Client04 CompanyName04
What I'm trying to do is: When you select a Client on the form using the
cmb_SelectClient combo box , if that CompanyName is null in
qry_Former_Clients, then mark the Former field check box on the form as True.
I keep getting the following error message:
'3075': Syntax error (missing operator) in query expression '[Client] =
NameOfClient
This is the code I'm using (I've tried placing the code in After Update and
then On Change):
Dim SupptClient As Variant
SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client]
= " _ & Forms!Clients!Company)
If SupptClient Is Null Then
Forms!Clients!Former = True
End If
Please help me figure this out.
Thanks,
Rachel
hope I explain it clear enough.
I have a form with a combo box that lets you select which client record you
want to go to. The name of this combo box is cmb_SelectClient.
There is also a check box called Former on the form.
I also have a query called qry_Former_Clients which joins 2 tables
tbl_SupportClients, tbl_AllClients. This gives me all the clients in hte
tbl_SupportClient table and the matching clients in the tbl_AllClients. For
Example:
tbl_SupportClients.Client tbl_AllClients.CompanyName
Client01 CompanyName01
Client02 CompanyName02
Client03 Null
Client04 CompanyName04
What I'm trying to do is: When you select a Client on the form using the
cmb_SelectClient combo box , if that CompanyName is null in
qry_Former_Clients, then mark the Former field check box on the form as True.
I keep getting the following error message:
'3075': Syntax error (missing operator) in query expression '[Client] =
NameOfClient
This is the code I'm using (I've tried placing the code in After Update and
then On Change):
Dim SupptClient As Variant
SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client]
= " _ & Forms!Clients!Company)
If SupptClient Is Null Then
Forms!Clients!Former = True
End If
Please help me figure this out.
Thanks,
Rachel