Access VBA Macros | Messages and variables 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.

Software ==> Access VBA Macros  (25 exercises)
Version ==> Access 2010 and later
Topic ==> Messages and variables  (8 exercises)
Level ==> Average difficulty
Subject ==> Access training
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.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post