Access Video Quiz D2.1By Richard RostWhy Text Boxes Concatenate Numbers Rather Than Add Why can adding values from two Access text boxes sometimes produce 54 instead of 9? Welcome to another Microsoft Access Video Quiz. You will be asked five Developer-level questions covering VBA calculator concepts, including text concatenation, exponent expressions, error handling, division by zero, and validating input controls before using Val. Answer each question, check your score, and see how well you know Access VBA. Recommended CoursesWant More?Keywords |
||||||||||||
| Age | Subject | From | |
| 2 days | Post Your Quiz Score Here! | Richard Rost | |
More Information
Transcript
This is the VBA Calculator Edition for Developer Level Students.
I'm going to give you five questions. You're going to have three seconds to answer each one, so hit that pause button if you need more time. Keep track of your score.
Are you ready? Here we go.
Question one.
Why can adding values from two Access text boxes sometimes produce five four instead of nine?
Access rounds each value before adding it. The control values are being treated as text and concatenated. Access automatically performs multiplication first. The answer control can only display strings.
That one is B. The control values are being treated as text and concatenated.
Question two.
In VBA, which expression calculates the nth root of a positive number?
Take a look at your options. Figure it out. Pause if you need to.
I couldn't read them off because that right there is raising a number to a power, that caret symbol.
Question three.
What does On Error Resume Next do when VBA encounters a runtime error?
It ignores the error and continues with the next statement. It displays the error message and restarts the procedure. It sends execution to a named error handler automatically. It corrects the invalid value and reruns the statement.
That's going to be A. It ignores the error and continues with the next statement. On Error Resume Next.
Question four.
What is the best way for a calculated routine to handle an attempted division by zero?
Use On Error Resume Next for the entire procedure? Convert the zero to one before dividing. Let Access show its standard runtime error. Test the divisor first, then skip the calculation and show a useful message.
A little If Then statement there.
And question five.
A square root button uses only one input control. Which validation approach is most appropriate before converting values with Val?
Require every control on the form to contain a value. Check only the input control required by the square root operation for Null. Convert every control with Val first, then test the results for Null. Use On Error Resume Next so blank inputs are ignored.
I would check only the input control required by the square root operation for Null. No reason to check the rest of them.
Alright, how'd you do? Did you get all five right? Are you the keeper of the computer lab key and the one printer that works? Or did you type your name at the C prompt and wait for something to happen?
Well, if you missed any, these topics and a lot more are covered in Access Developer Level Two Lesson One, where we start building a calculator.
Thanks for playing. Share your score down below in the comments and try not to print it on the dot matrix printer one character at a time.
Until next time, live long and prosper.Intro
|
| |||
| Keywords: Access Video Quiz, VBA calculator, Access text box concatenation, VBA Val function, VBA nth root, VBA exponent operator, On Error Resume Next, VBA division by zero, VBA Null validation, calculated control values PermaLink Why Text Boxes Concatenate Numbers Instead of Adding in Microsoft Access Video Quiz D2.1 |