Set Value Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that lists all rooms for a specific customer. For each room
there is 5 checkboxes (Stage 1,2,3,4,5). The checkboxes are checked in order
of 1,2,3,4,5 as each stage is completed. After the checkboxes are checked
the user clicks on a command button that takes them to another form that
lists all of the materials ordered for that room. Each product has a field
called WIP (this is a combo box with 5 values: WIP 1, WIP 2, WIP 3, WIP 4,
WIP 5). There is also another check box called Deplete for each product.

I'm trying to create a macro that will do the following:
If Stage 1 is checked in the Room form every product with the value of
WIP 1 will have its Deplete checkbox checked automatically.
If Stage 2 is checked in the Room form every product with the value of
WIP 2 will have its Deplete checkbox checked automatically.
The same is true for the other Stages.

Thank you in advance for your help.
 
Matt,

It is not clear whether your Stage 1-5 checkboxes are part of an Option
Group bound to a single field (which would be a good approach), or
whether you have 5 separate fields for the 5 Stages (which will make
things unnecessarily difficult for you). But in either case, this is
really a job for an Update Query. If I understand you correctly, the
SQL view of such a query would look something like this...
UPDATE Products SET Deplete=-1 WHERE WIP = "WIP 1"
.... and similarly for 2, 3, 4, 5.
Then, you can use a macro using an OpenQuery action to run the
applicable Update Query. Assign the macro on the After Update event
property of the Stage option group or check boxes as applicable.
 
Back
Top