Access Video Quiz D2.4By Richard RostCan You Spot VBA SQL INSERT Field Order Bug? Which SQL statement adds a new record without changing existing records? Welcome to another Microsoft Access Video Quiz. You will be asked five Developer-level questions about Access VBA, including INSERT INTO statements, field names, SQL string continuation, handling Null values, and the order in which variable values are used when building an SQL statement. Recommended CoursesWant More?Keywords |
||||||||||||
| Age | Subject | From | |
| 15 days | Post Your Quiz Score Here! | Richard Rost | |
More Information
Transcript
This is a developer-level quiz on Access VBA. I got five questions for you. You'll have three seconds to answer each one. Pause the video if you need more time, and keep track of your score.
Our Mars colony has a few records to log. Let's see if your code is ready for duty.
Question 1.
VBA button must add one new log record without changing existing records. Which SQL statement should it pass to DoCmd.RunSQL? Insert into values, update set, select from, or select into.
That'll be insert into values.
Question 2.
An insert into field list names commission, but commission T has no such field. The form has a commission text box. What fixes the missing destination field? Rename the form's text box commission T, put commission in the field list, add the expected commission field to commission T, or move commission earlier in the values list.
That's C, add the expected commission field to commission T.
Question 3.
A long SQL string is split across VBA lines using ampersand underscore. What do those two characters do? Ampersand adds a line while underscore joins the strings. Ampersand continues the statement. Underscore starts a comment. Ampersand joins the strings, underscore executes SQL, or ampersand joins the strings, underscore continues the statement.
That is D, ampersand joins the strings, underscore continues the statement.
Question 4.
An unbound text box accepts null and empty text. A guard stops when IsNull(Me.Notes) is true. Which reset makes that guard stop the next click? Me.Notes equals an empty string, Me.Notes equals Null, Me.Notes equals Null in quotes, or Me.Notes equals quote space quote.
That'll be B. That Notes equals Null.
And question 5.
Employee ID equals 7 and commission equals 50 are numeric variables. Both target fields allow these values. What does this code insert?
Read that code carefully and tell me what the answer is. Commission 50, employee ID 7; commission 9, employee ID 50; commission 7, employee ID 50; or commission 50, employee ID 9.
Take a moment and look that over. Pause if you need to.
The answer is commission 7, employee ID 50. Employee ID equals 9 happens after the SQL statement is built.
All right, how'd you do? Did you get 5 out of 5? Are you the one who saved the Martian data colony? Or are you still training the office rover?
Well, if you missed any of these topics, and more are covered in Microsoft Access Developer Level 2. You'll learn how to use VBA to add records to a table and reset your form for the next entry. Links down below.
Thanks for playing. Post your score in the comments, and keep the rover away from the keyboard.
Until next time, live long and prosper.Intro
|
| |||
| Keywords: Access Video Quiz, Access VBA DoCmd.RunSQL, INSERT INTO VALUES, VBA add record to table, SQL field list, IsNull unbound text box, VBA reset text box to Null, VBA line continuation, SQL values field order PermaLink Can You Spot a VBA SQL INSERT Field Order Bug in Microsoft Access? Video Quiz D2.4 |