L
LeftyLeo via AccessMonster.com
Hi all,
I know this should be easy but I can not get this sql statement to work. It
gives a compile error at the end of the statement. I am not sure how many
qoutes to place with the semi-colon when have more than 1 lookup variable(?)
Here is the statement:
"SELECT tblMasterTable.PrimaryKey, tblMasterTable.fldDate, tblMasterTable.
fldLocation, tblMasterTable.fldZone, tblMasterTable.fldPeriod, tblMasterTable.
fldYear, tblMasterTable.[Beginning Balance], tblMasterTable.fldOrganization,
tblMasterTable.fldAddress, tblMasterTable.fldDescription, tblMasterTable.[Req
Letter on File], tblMasterTable.[501 (c) 3 Number], tblMasterTable.[Focus
Area], tblMasterTable.[Donation Description], tblMasterTable.fldAmount,
tblMasterTable.fldCity, tblMasterTable.fldState, tblMasterTable.fldZip FROM
tblMasterTable WHERE (tblMasterTable.fldLocation)='" & DLookup("[fldLocID]",
"tblCurrentUserInfo") And ((tblMasterTable.fldYear) ='" & strYear & "';"
What am I doing wrong? Any help would be appreciated.
I know this should be easy but I can not get this sql statement to work. It
gives a compile error at the end of the statement. I am not sure how many
qoutes to place with the semi-colon when have more than 1 lookup variable(?)
Here is the statement:
"SELECT tblMasterTable.PrimaryKey, tblMasterTable.fldDate, tblMasterTable.
fldLocation, tblMasterTable.fldZone, tblMasterTable.fldPeriod, tblMasterTable.
fldYear, tblMasterTable.[Beginning Balance], tblMasterTable.fldOrganization,
tblMasterTable.fldAddress, tblMasterTable.fldDescription, tblMasterTable.[Req
Letter on File], tblMasterTable.[501 (c) 3 Number], tblMasterTable.[Focus
Area], tblMasterTable.[Donation Description], tblMasterTable.fldAmount,
tblMasterTable.fldCity, tblMasterTable.fldState, tblMasterTable.fldZip FROM
tblMasterTable WHERE (tblMasterTable.fldLocation)='" & DLookup("[fldLocID]",
"tblCurrentUserInfo") And ((tblMasterTable.fldYear) ='" & strYear & "';"
What am I doing wrong? Any help would be appreciated.