Query with special characters

  • Thread starter Thread starter Connie
  • Start date Start date
C

Connie

I'm trying to figure out the best way, if any, to query on a text field that
has the following type of data. P1052.2, P1052.3, etc. I've tried replacing
the . with an * but it does not bring up a specific record, instead all the
numbers, such as, P1052.3, P1052.13, P1052.30 etc. Does anyone have a
solution or is something that would require some VB or VBA?
 
I would like to enter in the criteria P1052.3, but when I do that, I get an
error message saying that dot is not allowed.
 
Thank you. That worked. If I need to query many at a time, I probably will
have to create a macro first to add the double quotes prior to entering them
into the query window. Is there a way to do this directly in an access query?
 
It isn't clear what you are attempting to do. Generally you should use
controls on forms to enter all dynamic (changing) criteria in queries.
 
The Access database that I am using is connected by ODBC to another
application, so it is Read Only. The application does not have a very good
search feature. What I need to do is pull data using the record ID (P1052.3).
This is where I'm having the problem, because the record ID has a dot in it.
The double quote worked fine for one record at a time, but If I had many, I
would need to manually add the double quotes. Do you know of another way to
acheive this in a more automated way? I'm thinking that I would need to
export the data into Excel, then create a function that would add the double
quotes for me, then copy those number into the query window. Does that sound
like the only way to accomplish what I'm trying to do? Hopefully this makes
sense.
 
It sounds like you want to select many multiple, non-contiguous IDs. I would
normally use a multi-select list box. There are lots of good resources on how
to use multi-select list boxes in query criteria.
 
Back
Top