Runtime Error 3075

R

RFrechette

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
 
D

Douglas J. Steele

Since Client is a text field, you need quotes around the value you're using:

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client] = "
_
& Chr(34) & Forms!Clients!Company & Chr(34))
 
R

RFrechette

What is Chr(34)?

When I add that, I get:

Compile error: Can't find project or library.

Thanks.


Douglas J. Steele said:
Since Client is a text field, you need quotes around the value you're using:

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client] = "
_
& Chr(34) & Forms!Clients!Company & Chr(34))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RFrechette said:
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
 
D

Douglas J. Steele

Chr(34) is "

While you can get around the errror using

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", _
"[Client] = """ & Forms!Clients!Company & """"

(that's 3 double quotes before, and 4 after)

you really need to get the problem fixed, as it could cause other parts of
your application to stop working.

Your error message is symptomatic of a problem with the References
collection of your application.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RFrechette said:
What is Chr(34)?

When I add that, I get:

Compile error: Can't find project or library.

Thanks.


Douglas J. Steele said:
Since Client is a text field, you need quotes around the value you're
using:

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client]
= "
_
& Chr(34) & Forms!Clients!Company & Chr(34))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RFrechette said:
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
 
R

RFrechette

Thank you Douglas, I will give it a try and let you know how it goes.

Thanks again,

Rachel

Douglas J. Steele said:
Chr(34) is "

While you can get around the errror using

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", _
"[Client] = """ & Forms!Clients!Company & """"

(that's 3 double quotes before, and 4 after)

you really need to get the problem fixed, as it could cause other parts of
your application to stop working.

Your error message is symptomatic of a problem with the References
collection of your application.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RFrechette said:
What is Chr(34)?

When I add that, I get:

Compile error: Can't find project or library.

Thanks.


Douglas J. Steele said:
Since Client is a text field, you need quotes around the value you're
using:

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client]
= "
_
& Chr(34) & Forms!Clients!Company & Chr(34))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 
R

RFrechette

You were correct. When I checked the references there was one called
"Missing: Lotus Notes Automation Classes". I unchecked that one.

It's working great now.

Thank you so much for your help. I really appreciate you taking the time to
get me out of a jam.

Rachel

RFrechette said:
Thank you Douglas, I will give it a try and let you know how it goes.

Thanks again,

Rachel

Douglas J. Steele said:
Chr(34) is "

While you can get around the errror using

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", _
"[Client] = """ & Forms!Clients!Company & """"

(that's 3 double quotes before, and 4 after)

you really need to get the problem fixed, as it could cause other parts of
your application to stop working.

Your error message is symptomatic of a problem with the References
collection of your application.

Open any code module, then select Tools | References from the menu bar.
Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


RFrechette said:
What is Chr(34)?

When I add that, I get:

Compile error: Can't find project or library.

Thanks.


:

Since Client is a text field, you need quotes around the value you're
using:

SupptClient = DLookup("[CompanyName]", "[qry_Former_Clients]", "[Client]
= "
_
& Chr(34) & Forms!Clients!Company & Chr(34))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top