Please help!!!

abezuide

Registered User.
Local time
Yesterday, 17:32
Joined
May 7, 2004
Messages
30
I am using a query in my code
ssql5 = "select * from [my table] " _
& "where [my field1] = " & rstmyrecordset![my field1] _
& " and [my field2] = " & rstemyrecordset![my field2]

I then open the recordset like this
Set rsttemp = dbscurrent.OpenRecordset(ssql5, dbOpenDynaset)

My problem is that my data has brackets like this
rstmyrecordset![my field1] = blue(s)

I get a runtime error 3075 that says: invalid use of '.','!' or '()' in query expression. However, this is a user database and I cannot change the way their data looks. Is there any way I can make access read the brackets in the data without giving me an error?
 
You might want to try

Code:
& "where [my field1] = " & Chr$(34) & rstmyrecordset![my field1] _
& Chr$(34) & " and [my field2] = " & Chr$(34) & rstemyrecordset![my field2] & Chr$(34)
 

Users who are viewing this thread

Back
Top Bottom