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.PmtI D,
tblPmtsRcd.Invo iceNumber, tblPmtsRcd.Vehi cleJobID,
tblPmtsRcd.PmtR ecTDStamp _
FROM tblPmtsRcd LEFT JOIN tblinvoiceData ON
tblPmtsRcd.Invo iceNumber = tblinvoiceData. InvoiceNumber _
WHERE tblPmtsRcd.Invo iceNumber<>0 And tblPmtsRcd.Invo iceNumber
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.
(a)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT * FROM Employees")
(b)
Set qdfTemp = .CreateQueryDef ("", _
"SELECT DISTINCTROW tblPmtsRcd.PmtI D,
tblPmtsRcd.Invo iceNumber, tblPmtsRcd.Vehi cleJobID,
tblPmtsRcd.PmtR ecTDStamp _
FROM tblPmtsRcd LEFT JOIN tblinvoiceData ON
tblPmtsRcd.Invo iceNumber = tblinvoiceData. InvoiceNumber _
WHERE tblPmtsRcd.Invo iceNumber<>0 And tblPmtsRcd.Invo iceNumber
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.
Comment