Skip to content
Artwork for Computer Learning Zone
Computer Learning Zone · Yesterday · 3 min

Microsoft Access VBA Rnd Function Quiz: Random Numbers, Randomize, and Int

Test your Microsoft Access VBA random-number knowledge with five quick questions about Rnd, Randomize, Int, and constants. This episode covers the details behind generating random values that actually fall within the range you expect. Rnd returns a decimal value from zero up to, but not including, one. That sounds simple, but it is the source of many off-by-one mistakes when code needs a die roll, quiz question number, or other whole-number result. We also look at why Randomize matters, what Int does to positive decimal values, and the expression used to produce a whole number from 1 through a chosen maximum. A short developer-level refresher for keeping your random results from turning into random bugs.

0:00-3:32

transcript

No transcript — this publisher did not publish one.

show notes

Test your Microsoft Access VBA random-number knowledge with five quick questions about Rnd, Randomize, Int, and constants. This episode covers the details behind generating random values that actually fall within the range you expect.

Rnd returns a decimal value from zero up to, but not including, one. That sounds simple, but it is the source of many off-by-one mistakes when code needs a die roll, quiz question number, or other whole-number result.

We also look at why Randomize matters, what Int does to positive decimal values, and the expression used to produce a whole number from 1 through a chosen maximum. A short developer-level refresher for keeping your random results from turning into random bugs.