Visual Basic for Applications
Attaching code to forms exercise
Relatively easy

This Visual Basic for Applications ATTACHING CODE TO FORMS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ACCESS VISUAL BASIC course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Changing a simple form property

A full answer to this exercise is provided as part of the training course!

1) Download the files needed to start this exercise: exercise-253.zip (and click here if you experience any problems unzipping this file after downloading it).
2) Every form has a Modal property:
Exercise screen-shot 412 When set to Yes you will not be able to go to any other form while it is open
3) Create a procedure which:
  • Opens the TeamPlayers form in design view;
  • Changes the modal property to True; then,
  • Closes the form, saving the changes.
4) If you have time, experiment with other form properties.
Training exercise hint Use can use the command DoCmd.Echo False at the start of the code to suppress screen changes, so that your macro doesn't look messy while it runs - but make sure to reverse it at the end of the code!

Thank you for showing an interest in this Access Visual Basic training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content copyright Wise Owl Business Solutions Ltd 2008.  All rights reserved..