3075: Syntax error (missing operator) in query expression

  • Thread starter Thread starter siaosanko
  • Start date Start date
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!!
 
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.
 
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 !!!
 
Back
Top