Note: This part of the assignment is optional. I don't think you would normally use a macro to do what this one will do (update a field). But this is good practice for when we create macros in Microsoft Excel in a few weeks.
- Replace the dropdown fields at bookmarks Result1 and Result2 with text fields with the same names.
- Make a practice run of the procedure.
- With the template open and the form locked, hit the Select Browse Object button (a little circle between the blue double arrows below the scroll vertical scroll bar.
- Select Go To (the little arrow in the lower left).
- In the Go to what area select Bookmark. From the dropdown list, choose Result1.
- Hit CTRL-C to copy the contents of the text field at Result1.
- Use the Select Browse Object again to Go To the bookmark named Result2.
- Hit CTRL-V to paste the copied text into the text field.
- Use Go To one last time to go back to Result1.
- Try this procedure a couple of times until you have it smooth.
- With the template open, be sure that the form is unlocked. Then select Tools, Macros, Record New Macro.
- The Record Macro dialogue opens.
- For the Macro name, enter autoChangeResult2.
- For the Store macro in setting, select the template you are currently working on.
- In the description, enter "Update Result1 based on Result2, recorded by XXX on xx/xx/00" (substituting your initials and today's date.
- Click OK. Warning! Once you click OK the macro recorder will record every key stroke you make.
- Run through the GoTo, Copy, GoTo, Paste, GoTo procedure you learned above.
- When you are finished, click the Stop Recording button on the macro toolbar.
- Associate the macro with Result1.
- Unlock the form.
- Double click on the field at Result1 to open the Text Form Field Options dialogue.
- In the Run on exit area, select autoChangeResult2.
- Click OK.
- Relock the form and save the template.
- Now when you fill in the test result in Result1, it will automatically be filled into Result2.
Top | ENV* K105 home | Environmental Engineering Technology home
Anthony G Benoit