I am having a little trouble with using the select/where clause to reduce my recordset. I am using DAO.
My problem is knowing when to use the double quotes or single quotes when dealing with constants.
Example: I load the select statement into a string and then open the recordset with the string variable.
Dim rsOrg as recordset
strOrg = "Select * from InnRecur "
Set rsorg = Org.OpenRecordset(strOrg)
** what I want to do is this instead of above
strOrg = "Select * from InnRecur where "
strOrg = strOrg & "rsOrg!editcode = " & "R"
strOrg = strOrg & " or rsOrg!editcode = " & "S"
I keep getting expecting additional arguments in the openrecordset statement.
Charlie
My problem is knowing when to use the double quotes or single quotes when dealing with constants.
Example: I load the select statement into a string and then open the recordset with the string variable.
Dim rsOrg as recordset
strOrg = "Select * from InnRecur "
Set rsorg = Org.OpenRecordset(strOrg)
** what I want to do is this instead of above
strOrg = "Select * from InnRecur where "
strOrg = strOrg & "rsOrg!editcode = " & "R"
strOrg = strOrg & " or rsOrg!editcode = " & "S"
I keep getting expecting additional arguments in the openrecordset statement.
Charlie