In my table, some records include a pound sign character (#) in the FirstLine field, and some don't. I'm trying to determine which records do have a # using the following code:
The # character is being treated as a wild card and setting blnPound to True for every record. If I add single quotes ('#'), it doesn't set blnPound to True for any records.
How to I get VBA to recognize the # character as a string character and not a wild card?
Thanks,
Sup
P.S. I'm using Access 2000
Code:
Dim rst as DAO.Recordset
Dim str as string
Dim blnPound as Boolean
Set rst = Currentdb.Openrecordset("Table1")
rst.MoveFirst
Do Until rst.EOF
str = rst!FirstLine
If inStr(1,str,"#") > 0 Then
blnPound = True
End if
rst.MoveNext
Loop
The # character is being treated as a wild card and setting blnPound to True for every record. If I add single quotes ('#'), it doesn't set blnPound to True for any records.
How to I get VBA to recognize the # character as a string character and not a wild card?
Thanks,
Sup
P.S. I'm using Access 2000
Last edited: