String 2112-E interpreted as 2112 minus E

DocNice

Registered User.
Local time
Today, 07:02
Joined
Oct 6, 2004
Messages
76
Here is my code:

rs.FindFirst "[Field1] = " & string1

string1 = "2112-E"

But the vb is interpreting that as "2112" minus E, trying to subtract the E.

Any way to get this to interpret this string as text only?
 
Doc,

When you present this to Access:

string1 = "2112-E"

It interprets it as:

string1 = 2112-E

You need to present it as:

string1 = "'2112-E'"

So it will interpret it as:

string1 = '2112-E'

If the "2112-E" was contained in a variable named "srchString":

string1 = "'" & srchString & "'"

You will learn to love syntax,
Wayne
 

Users who are viewing this thread

Back
Top Bottom