SQL coding not working in VBA

  • Thread starter Thread starter vdha via AccessMonster.com
  • Start date Start date
V

vdha via AccessMonster.com

I am trying to run this query in VB but I must have it written wrong but I
can't find where.
Could some body help me out

RS.Open "Select email from team where SONumber = '" & SONumber & "' and where
Financialaccess ='" & 1 & "'", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic

Thanks
 
You have two Where statement; remove the second one (but keep the AND, of
course). Also, if Financialaccess is of type integer, then enclosing the
value 1 between single quotes might be wrong.
 
Now, it is working.
Thanks for your quick help Sylvain


Sylvain said:
You have two Where statement; remove the second one (but keep the AND, of
course). Also, if Financialaccess is of type integer, then enclosing the
value 1 between single quotes might be wrong.
I am trying to run this query in VB but I must have it written wrong but I
can't find where.
[quoted text clipped - 6 lines]
 
Back
Top