Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double Quotes Search Peram 1

Status
Not open for further replies.

ronniMIS

MIS
Apr 28, 2003
6
IN
Please can someone advise re the following search peram that i just cant get right.

like '*"a14_*'

will ignore the quote ,any suggestions on forcing this ??

thanks in advance

 

There's nothing obviously wrong with it. It works in an Access query for me. Where are you using it?
 
Hi,

Try this:

Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As string
Dim f As string
a = "'" 'need to seperate the special characters and denote them as a string
b = "*"
c = """"
d = "a14_"
e = Mid(c, 1, 1) ' takes just "
f = a & b & e & d & b 'Puts them all together as 1 long string
'*"a14_*'
Like Mid(f, 2, 9) 'the mid(f,2,9) takes out the quotes that vb adds in to denote that its a string.

 
Im trying to query in Access VBA for a query that works in the grid as like *A14 , when i try to run this as part of the VB modules/VBA it errors . have tried to run the string entrys, but to no avail any ideas what im doing wrong?.

The goal is to auto query the data and auto amend after modify then export to text file for input into another Database.

thanks in advance
 
Hi ronniMIS,

I suspect your problem is to do with the way you build the query string in VBA. You will need to double up on some quotes, something like.

Code:
SelectString = FirstPart & "Like '*""A14_'" & RestOfQuery

Enjoy,
Tony

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top