ACCESS VBA MACROS EXERCISES▼
Access VBA Macros | Messages and variables exercise | Running a simple query to show films winning 10 Oscars
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.
You can learn how to do this exercise on the relevant Wise Owl classroom training course (sadly for the moment only in the UK).
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.
Find and double-click on the query called qryDoubleDigitOscars - it should list out the films which won at least 10 Oscars:
The best 4 films ever made? Perhaps not.
Your task now is to do the same thing in VBA! Read on ...
Close the query down, and create a new subroutine called ShowDDOscars (either in a new module, or one you've already created). This subroutine should:
- Open the query above.
- Use the MsgBox command to display a message summarising the results.
- Close the query down.
Here's what you should see on screen:
Feel free to change the text of the message to something more in line with your own taste.
Save and close this module.