J
Joseph Greenberg
I have a form for which the recordsource is a query, with the SQL as
follows:
SELECT tMemberHeader.FamNo, tMemberHeader.FamilyName,
tMemberHeader.FamilyName2, tMemberHeader.Member1Title,
tMemberHeader.Member1, tMemberHeader.Member2Title, tMemberHeader.Member2,
tMemberHeader.LabelNameFormal, tMemberHeader.LabelNameInformal, [FamilyName]
& ", " & [Member1] & IIf([Member2]<>""," & " & [Member2]) AS LookupName,
tMemberHeader.Address1, tMemberHeader.Address2, tMemberHeader.City,
tMemberHeader.State, tMemberHeader.Zip, tMemberHeader.[Zip+4],
tMemberHeader.Country, tMemberHeader.SAddress1, tMemberHeader.SAddress2,
tMemberHeader.SCity, tMemberHeader.SState, tMemberHeader.SZip,
tMemberHeader.[SZip+4], tMemberHeader.SCountry, tMemberHeader.SPhone,
tMemberHeader.HomePhone, tMemberHeader.HomeFax, tMemberHeader.FamilyNotes,
tMemberHeader.MemberType, tMemberHeader.OtherShulMembership,
tMemberHeader.RecordCreateDate, tMemberHeader.MemberApplDate,
tMemberHeader.MemberApprDate, tMemberHeader.MemberStartDate,
tMemberHeader.OmitFromRinatDirectory, tMemberHeader.ExtractTag
FROM tMemberHeader
ORDER BY tMemberHeader.FamilyName, tMemberHeader.Member1;
Note the embedded "IIF" statements with embedded quotes. The query works
fine. I now want to offer the ability to add a "WHERE" clause based on
various checkboxes. How can I create a string variable that handles those
double-quotes properly? I tried doubling them up, I tried replacing with
single quotes, embedding single-quotes, none of that worked.
What is the suggested way to do this?
Thanks
follows:
SELECT tMemberHeader.FamNo, tMemberHeader.FamilyName,
tMemberHeader.FamilyName2, tMemberHeader.Member1Title,
tMemberHeader.Member1, tMemberHeader.Member2Title, tMemberHeader.Member2,
tMemberHeader.LabelNameFormal, tMemberHeader.LabelNameInformal, [FamilyName]
& ", " & [Member1] & IIf([Member2]<>""," & " & [Member2]) AS LookupName,
tMemberHeader.Address1, tMemberHeader.Address2, tMemberHeader.City,
tMemberHeader.State, tMemberHeader.Zip, tMemberHeader.[Zip+4],
tMemberHeader.Country, tMemberHeader.SAddress1, tMemberHeader.SAddress2,
tMemberHeader.SCity, tMemberHeader.SState, tMemberHeader.SZip,
tMemberHeader.[SZip+4], tMemberHeader.SCountry, tMemberHeader.SPhone,
tMemberHeader.HomePhone, tMemberHeader.HomeFax, tMemberHeader.FamilyNotes,
tMemberHeader.MemberType, tMemberHeader.OtherShulMembership,
tMemberHeader.RecordCreateDate, tMemberHeader.MemberApplDate,
tMemberHeader.MemberApprDate, tMemberHeader.MemberStartDate,
tMemberHeader.OmitFromRinatDirectory, tMemberHeader.ExtractTag
FROM tMemberHeader
ORDER BY tMemberHeader.FamilyName, tMemberHeader.Member1;
Note the embedded "IIF" statements with embedded quotes. The query works
fine. I now want to offer the ability to add a "WHERE" clause based on
various checkboxes. How can I create a string variable that handles those
double-quotes properly? I tried doubling them up, I tried replacing with
single quotes, embedding single-quotes, none of that worked.
What is the suggested way to do this?
Thanks