Select Statement (from earlier post)

  • Thread starter Thread starter DJ
  • Start date Start date
D

DJ

Attempting to get this syntax correct:
Alex sent an earlier reply, but it produced an error
also. Would someone else take a look at this.
Thanks

strSQL = "SELECT count(*) As MyCount FROM Registration
where Field48 = " & Me.Barcode_Number And "Field49 = '" &
IR & " '"

I am attempting to use the two pieces of info on a form
(1) a integer field on a form and (2) a string value on
the form. But, this damn syntax is killing me. Can
someone help in getting this statement syntax correct.
Would appreciate it.
 
if Me.Barcode_Number - number and IR (prpbably me.IR) - string then:

strSQL = "SELECT count(*) As MyCount FROM Registration where Field48 = " &
Me.Barcode_Number & " And Field49 = """" & IR & """"
 
"""" is 4 times "

Alex Dybenko said:
if Me.Barcode_Number - number and IR (prpbably me.IR) - string then:

strSQL = "SELECT count(*) As MyCount FROM Registration where Field48 = " &
Me.Barcode_Number & " And Field49 = """" & IR & """"
 
Change:

.... & Me.Barcode_Number And "Field49 = ...

to:

.... & Me.Barcode_Number & " And Field49 = ...

Note the space after the "

HTH,
TC
 
Back
Top