I don't understand why (a) works and compiles but (b) does not...
(a)
Set qdfTemp = .CreateQueryDef("", _
"SELECT * FROM Employees")
(b)
Set qdfTemp = .CreateQueryDef("", _
"SELECT DISTINCTROW tblPmtsRcd.PmtID,
tblPmtsRcd.InvoiceNumber, tblPmtsRcd.VehicleJobID,
tblPmtsRcd.PmtRecTDStamp _
FROM tblPmtsRcd LEFT JOIN tblinvoiceData ON
tblPmtsRcd.InvoiceNumber = tblinvoiceData.InvoiceNumber _
WHERE tblPmtsRcd.InvoiceNumber<>0 And tblPmtsRcd.InvoiceNumber
Is Not Null AND tblinvoiceData.InvoiceNumber Is Null")
' Open Recordset and print report.
GetrstTemp qdfTemp
Isn't (b) just a longer SQL string with continuation characters and
(a) a shorter SQL string with continuation characters?
Everytime I type the Set statement in (b) into a module, it turns
red and gives me an error. I do not recognize what is wrong.
With the damned newsreader wrapping - you may not be able
to see what I'm doing wrong either. Sorry about that. Would
like to know. If I type EVERYTHING on one line - no problem.
But when I try using line continuation characters everything
turns red.