Why is this strSQL not working??? Please Help
OK,
In your original post you said: "If I take out the Dlookup part all is well
......".
What does the SQL string look like if you add: Debug.Print SQL ?
If you replace the DLOOKUP() with a value, say 5, is all still well?
Const strSQL = "SELECT tblLister.lListerID, tblLister.lFirstName,
tblLister.lLastName, tblLister.leMailAddress, tblLister.lFaxNumber,
tblLister.lCellPhoneNumber, tblLister.lOtherPhoneNumber,
tblLister.lPhoneNumber, 5 AS BrokerID, tblListerListing.llListingID,
tblListerListing.llSaleAmount, tblListerListing.llInActiveOrSold,
snip
Debug.Print SQL
What does the string look like?
I still say that embedding a VBA function inside a SQL string, the function
won't be evaluated. The function return value needs to be concatenated to the
SQL string.
Did you try concatenating the DLOOKUP() function to the SQL string (see my
first post)?
My ideas on your problem..... I'll back to sleep now.
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
|