data collection and THEN QUERY

C

Cat

I am converting and updating a business contact database.
the first search is on "LAST NAME". that works fine.

I would like to have a query that first prompts the user for the name of the
field that they would like to search on and then it runs a basic select query
(select * from "tablename" where "user_selected_field_name" =
"user_provided_criteria"). Anybody got any ideas?
Thanks in advance for any and all replies.

P.S. the "user" table has the usual fields such as last name, first name,
company, address1, address2, city, state, group, etc.
 
K

KARL DEWEY

I would use another method to do it as I do not think your idea is possible.
Add unbound textboxes for each of your possible criteria and a search button
to run the query.
In the query put criteria for each field like --
Like Iif([Forms]![YourForm]![YourLastNameTextBox] Is
Null,"",[Forms]![YourForm]![YourLastNameTextBox]) & "*"

Do the same for all of the textboxes. Using this method the user can search
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top