Combining multiple Update Queries

K

KittyKathy

Hi

I get a database file with "AUX Codes" ie 11000, 12000 etc. They don't
mean much in numbers thus i have created 15 separate update queries that
change them to something a little more meaningful ie changes 11000 to
Meal Break.

Instead of having the run each separate update queries 15 times, i was
wondering if there is any way to run all 15 at once in a master update ?

Im sure there is a way via the macros and or Vb scripts but sadly my
knowledge does cover these topics

Any help would be much appreciated

Thanks

- Kath
 
J

Jackie L

If you have a form, put a button on it and hit cancel during the button
wizard. Then, on this button properties, on the On Click event, choose Event
Procedure and click on the ...

You will then be in the VB editor. Put the following code on your button.

DoCmd.SetWarnings False
DoCmd.OpenQuery "NameOfQuery1"
DoCmd.OpenQuery "NameOfQuery2"
etc for all queries
DoCmd.SetWarnings True

Close the VB window.

Hope this helps.
Jackie
 
R

Randy Griffin

Kath,
I wouldn't replace the codes with text at all, or even update another field
based on them. I'd suggest creating a new table with two fields:

Aux_Code
Aux_Code_Desc

Set a relationship from your main table to this one, joined on the AUX_Code.
Then the description is available to you when you need it. No update queries
are required, and if you need to add any codes or change a description you
just update the table.
 
K

KittyKathy

Thanks Jackie, what you said works but sadly i dont use forms in this
database.

I only use quires and Reports. Is it possible to do this with a report
or some other way

Thanks so much

- Kath
 
Top