3075: Syntax error (missing operator) in query expression

S

siaosanko

Hi,

I'm writing in VBA MS access, and when i run my form i got a runtim
error: 3075
and it was debugged at the following code:

I can't figure it out what's wrong with my code, would you please help
me out with it?

Thanks a lot!!!

The error message points at "Mod = "", but i don't know what's wrong ?

======================================

strSQL = "Select * from Result where Proc = '" & Trim(rsTarget!Proc)
& "' And Mod = '" & Trim(rsTarget!Mod) & "'"
Set rs2 = CurrentDb.OpenRecordset(strSQL)

=======================================

Thansk a lot for the help!!
 
S

Stuart McCall

Hi,

I'm writing in VBA MS access, and when i run my form i got a runtim
error: 3075
and it was debugged at the following code:

I can't figure it out what's wrong with my code, would you please help
me out with it?

Thanks a lot!!!

The error message points at "Mod = "", but i don't know what's wrong ?

======================================

strSQL = "Select * from Result where Proc = '" & Trim(rsTarget!Proc)
& "' And Mod = '" & Trim(rsTarget!Mod) & "'"
Set rs2 = CurrentDb.OpenRecordset(strSQL)

=======================================

Thansk a lot for the help!!

You need to change the name of the field 'Mod'. That is a VBA keyword (for
the Modulus operator). Access will get confused by this.
 
S

siaosanko

You need to change the name of the field 'Mod'. That is a VBA keyword (for
the Modulus operator). Access will get confused by this.

Thanks!!I try both of your suggesstions. And you are both right..
Especially the name i choose is certainly wrong.. thanks !!!
 

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

Top