|
Access Video Quiz D1.5 By Richard Rost What Does Exit Sub Do in VBA Button Event Code? What does Exit Sub do when VBA executes it inside a button's event procedure? Welcome to another Microsoft Access Video Quiz. You will be asked five Developer-level questions covering VBA If statements, Else sections, moving to a new record, and preserving product prices in order details. Answer each question, check your score, and see how well you know Microsoft Access. Recommended CoursesWant More?Keywords |
||||||||||||
| Age | Subject | From | |
| 4 days | Post Your Quiz Score Here! | Richard Rost | |
More Information
Transcript
Today's quiz is for the developer level users. I'm going to give you five questions coming out real fast. You're going to get three seconds to answer each one. Feel free to hit that pause button if you need more time. Keep track of your score. We'll see how you did at the end. Are you ready? Here we go.
Question one. What does Exit Sub do when VBA executes it inside a button's event procedure?
A. Saves the current record and closes the form.
B. Ends the current procedure immediately.
C. Deletes the selected control.
D. Sends the code on a vacation.
That's B. Ends the current procedure immediately, although a vacation does sound nice.
Question two. In a multi-line VBA If block with no Else section, what happens when the condition is false?
A. The entire procedure automatically ends.
B. The statements inside the If block run once anyway.
C. The If block is skipped and code continues after End If.
D. Access converts the form into a report.
That's going to be C. The If block is skipped, and code continues after the End If.
Question three. What's the purpose of an Else section in a VBA If statement?
A. It runs as an alternate set of statements when the If condition is false.
B. It repeats the If test until it becomes true.
C. It exits every open form in the database.
D. It changes a Null value to a zero automatically.
That's going to be A. It runs an alternate set of statements when the If condition is false.
Question four. Which VBA statement moves the current form to a blank record?
Is it DoCmd.GoToControl New Record?
DoCmd.OpenForm acNewRecord?
SetValue NewRecord, True?
Or DoCmd.GoToRecord, , acNewRecord?
That one's going to be DoCmd.GoToRecord, , acNewRecord, and there's no chameleons involved.
And finally, question five. Why is it often better to copy a selected product's current price into an order detail record instead of always displaying the live price from the product table?
A. It keeps every order synchronized with future catalog price changes.
B. It preserves the price that applied when the order was created.
C. It forces the combo box to display only one column.
D. It asks Access to consult a crystal ball.
The answer is B. It preserves the price that applied when the order was created. And if someone develops that crystal ball plugin, send it my way, please.
All right, how'd you do? Did you get all five? Did you get the deluxe edition with the holographic sticker that actually stuck to the box? Or did you click every toolbar icon for research purposes?
Well, if you missed any, this is all covered in my Access Developer Level One class, Lesson Five. Thanks for playing. Be sure to post your score in the comments down below, and until next time, live long and prosper.Intro
Quiz
A. Saves the current record and closes the form
B. Ends the current procedure immediately
C. Deletes the selected control
D. Sends execution to the next form
Q2. In a multi-line VBA If block with no Else section, what happens when the condition is false?
A. The entire procedure automatically ends
B. The statements inside the If block run once anyway
C. The If block is skipped and code continues after End If
D. Access converts the form into a report
Q3. What is the purpose of an Else section in a VBA If statement?
A. It runs an alternate set of statements when the If condition is false
B. It repeats the If test until it becomes true
C. It exits every open form in the database
D. It changes a Null value to zero automatically
Q4. Which VBA statement moves the current form to a blank new record?
A. DoCmd.GoToControl New Record
B. DoCmd.OpenForm acNewRecord
C. SetValue NewRecord, True
D. DoCmd.GoToRecord, , acNewRecord
Q5. Why is it often better to copy a selected product's current price into an order detail record instead of always displaying the live price from the product table?
A. It keeps every order synchronized with future catalog price changes
B. It preserves the price that applied when the order was created
C. It forces the combo box to display only one column
D. It automatically recalculates all past order totals
Answers: 1-B; 2-C; 3-A; 4-D; 5-B
DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.Summary
Question 1: What does Exit Sub do when VBA executes it inside a button's event procedure?
A. Saves the current record and closes the form.
B. Ends the current procedure immediately.
C. Deletes the selected control.
D. Sends the code on a vacation.
The correct answer is B. Exit Sub immediately stops the current procedure. Any statements following Exit Sub in that procedure will not run.
Question 2: In a multi-line VBA If block with no Else section, what happens when the condition is false?
A. The entire procedure automatically ends.
B. The statements inside the If block run once anyway.
C. The If block is skipped and code continues after End If.
D. Access converts the form into a report.
The answer is C. When the condition is false, VBA skips the statements inside the If block and continues with the first statement after End If.
Question 3: What is the purpose of an Else section in a VBA If statement?
A. It runs an alternate set of statements when the If condition is false.
B. It repeats the If test until it becomes true.
C. It exits every open form in the database.
D. It changes a Null value to zero automatically.
The correct answer is A. An Else section provides an alternate set of statements to run when the original If condition evaluates to False.
Question 4: Which VBA statement moves the current form to a blank record?
A. DoCmd.GoToControl New Record
B. DoCmd.OpenForm acNewRecord
C. SetValue NewRecord, True
D. DoCmd.GoToRecord, , acNewRecord
The answer is D. DoCmd.GoToRecord with the acNewRecord argument moves the current form to a new blank record, ready for data entry.
Question 5: Why is it often better to copy a selected product's current price into an order detail record instead of always displaying the live price from the product table?
A. It keeps every order synchronized with future catalog price changes.
B. It preserves the price that applied when the order was created.
C. It forces the combo box to display only one column.
D. It asks Access to consult a crystal ball.
The correct answer is B. Storing the product price in the order detail record preserves the price that was in effect at the time of the sale. If the catalog price changes later, previous orders still show the correct historical price.
If you got all five questions correct, excellent work. If you missed any, these topics are covered in my Access Developer Level 1 class, Lesson 5.
You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.Topic List
|
| |||
| Keywords: Access Video Quiz, VBA Exit Sub, VBA If Else statement, DoCmd.GoToRecord acNewRecord, order detail price history, preserve historical product prices, Access form new record, VBA button event procedure PermaLink What Does Exit Sub Do in a Microsoft Access VBA Button Event Procedure? Video Quiz D1.5 |