Microsoft Visual Basic
Looping exercise
Harder than average exercise

This Microsoft Visual Basic LOOPING 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: Creating a progress meter

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

1) Download the files needed to start this exercise: exercise-259.zip (and click here if you experience any problems unzipping this file after downloading it).
2) Create a progress meter form:
Exercise screen-shot 418 The bars appear over time.
3) More importantly, create a macro called Sub ProgressMeter(DurationMilliseconds as Long).
Training exercise hint This macro will loop over all the rectangles on the form, making the first invisible one that it finds visible.  It will then immediately exit, to avoid colouring all the bars on the first call.
4) Write the code so that it:
  • Opens the form in design view;
  • Sets the Timer Interval property to be the passed DurationInMilliseconds value;
  • Closes the form saving the changes;
  • Opens the form again and relies on the timer code you have written to run the meter and then close the form.

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..