Exercise: Running an action query to double film run times

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the Wise Owl course listed below!

Category ==> Access VBA Macros  (17 exercises)
Topic ==> Messages and variables  (3 exercises)
Level ==> Average difficulty
Course ==> Access VBA macros
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Try running the query called UpdateRunningTimes.  You should find that it doubles the running times of all films in the table called UKFilms.

In your existing module called modSimpleMacros, create another procedure called ChangeRunningTimes.

Add code to this procedure so that it:

  • Turns off any warning messages which would otherwise appear;
  • Runs the query called UpdateRunningTimes;
  • Turns warning messages back on again;
  • Opens the table of UKFilms so you can see if your macro has worked; and
  • Displays a message as shown below.

Your message should look something like this:

Access VBA Macros exercise - Messages and variables (image 1)

Here we have run the query several times 2,208 minutes of Harry Potter would be a long time

Test that your macro works, then save and close your module.

This page has 0 threads Add post