Question Make database with flexible search function

looks like you have a redundant asterix in there - i.e., there seem to be two in a row. you can either attempt to alter the string to fix it, or if the query works as is, and you've had enough (!) maybe you can leave it.

Code:
& sText &[COLOR=Red] "*" & "*'[/COLOR] ORDER BY
i'd personally try to fix it, but i'm OCD ;P

on my first attempt, i'd try changing that portion to:

Code:
& sText [COLOR=Red]& "*'[/COLOR] ORDER BY
 
Last edited:
Ok i'll fix this. Thanks :)

Is there also a way to search every column in a row? Now I select the row using a combo box, but I would like to add the feature search any column.

I've tried:

create a new query.

add any table with any field to it that has text.

then in the criteria for that field, type in

Code:
Like * & [enter partial search text] & *
or

Code:
Like * & metal & *
or similar.

run the query to check that it works.

now toggle to SQL view. this should get you on the right track in how to formulate the SQL in a VBA setting.

But then I get the following error:

You can't specify criteria for the asterisk (*).
 
there was someone else asking thee exact same thing a few months ago. let me see if i can dig up that thread for you. i'm pretty sure it was met with a solution...
 
actually, before getting to that what exactly are you wanting to do? are you wanting a complete solution across all the tables in your database, or are you wanting a 2 or 3 or 4 column query for one particular table/query?

and i've never had that error before, so i can't hep you out specifically there. google might be a better option for you in the immediate future.
 
here are a couple of threads from this forum which is relevant to your enquiry. i don't recall either of these being the one i'm thinking of, but maybe they'll work for you.

http://www.access-programmers.co.uk/forums/showthread.php?t=123514&highlight=search+multiple+columns

http://www.access-programmers.co.uk/forums/showthread.php?t=50659&highlight=search+multiple+columns

http://www.access-programmers.co.uk/forums/showthread.php?t=175348&highlight=search+fields

try those. i've got to get back to work now!
 
also, trying the trick i gave you earlier might not have worked if you added the "like" parts to the same criteria row. try "stepping" them across and down the fields (this simulates the OR rather than AND operations).
 

Users who are viewing this thread

Back
Top Bottom