N
Niklas Östrergren
Hi!
Is it possible to use qoutes ("") in a string in VBA?
I´m trying to create a SQL-string to be used to open a recordset but I need
to format some fields in this SQL-string in which qoutes are used. But I get
an error (text = red) when I try this code (below):
strSQL = "SELECT qryValidMemberShip.*, Format([MemberShipEndDate],"yyyy") AS
ValidMemberShipYear" _
& " FROM qryValidMemberShip" _
& " WHERE qryValidMemberShip.fkMemberShipTypeID =" & 5 & " AND
Format(qryValidMemberShip.MemberShipEndDate,"yyyy") =" &
Format(Date(),"yyyy"))"
It highlights the first "yyyy"!
Any idéas of how I solve this?
TIA!
// Niklas
Is it possible to use qoutes ("") in a string in VBA?
I´m trying to create a SQL-string to be used to open a recordset but I need
to format some fields in this SQL-string in which qoutes are used. But I get
an error (text = red) when I try this code (below):
strSQL = "SELECT qryValidMemberShip.*, Format([MemberShipEndDate],"yyyy") AS
ValidMemberShipYear" _
& " FROM qryValidMemberShip" _
& " WHERE qryValidMemberShip.fkMemberShipTypeID =" & 5 & " AND
Format(qryValidMemberShip.MemberShipEndDate,"yyyy") =" &
Format(Date(),"yyyy"))"
It highlights the first "yyyy"!
Any idéas of how I solve this?
TIA!
// Niklas