Can I create multiple queries using a script or command line?

P

Ptrope

I have an Access 2000 db in which I need to essentially duplicate an
existing query about 20 times, varying the field being searched on
with each one. Rather than cutting-pasting and changing the search
criteria in each one, is there a way I can make a simple script or
batch file to create the queries - or at least to copy and paste them
with new names, so I can manually change the search criteria in each
one?

TIA!
 
G

Guest

Why create 20 queries? Use a different row for each different criteria.
If you want to use it with different criteria but not all at the same time
then add a new field like this --
Search: [Enter search number]
Use a number in the criteria row corresponding to the search criteria like --
Field1 Field2 Field3 Search
"Box" 1
"Toy" 2
"Blue" 3
 
P

Ptrope

Ahh! I didn't know you could do that; I've piddled with Access, but
usually as a web backend and not for creating an application. Thanks
for the advice; I'll have to try that!
 
G

Guest

Also instead of hard entering the criteria in the query you can enter it in
the form.
Make sure to copy and paste the criteria so as not to have any typo errors.
 
P

Ptrope

Thanks, Karl!

I'll have to work with this and think about what I need to accomplish;
the database I'm creating is for an end user who isn't all that Access-
savvy (less than myself! :-D), so I'm making her queries form-based,
with little more to do than to choose which query she wants to run,
and then entering her keywords in a pop-up box. From your example, it
looks like I could pass the search number from the form, leaving the
only typing to be the keywords; then it's just a matter of populating
the results form properly. As I've built it, with unique queries and
forms that are essentially copies with modifications, I've also been
highlighting the field upon which she's queried the data, and I'd like
to do that still, if I can reduce the number of forms and queries, so
her end-user experience remains pretty much unchanged. Not being a
programmer, I hope I can find a way to do that easily.

Thanks for the suggestions you've offered!
 

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

Top