How to random select pictures on an ACCESS 2007 form

W

wmuirhead

I would like to have a form randomly select pictures from say 20 images as
one moves from one entry to the next.
 
K

Klatuu

I assume you have the pictures in a specific folder and you are using a
hyperlink field to point to the image to load. If you are doing this, you
could add a numeric (Long Integer would be best) field to the table that
holds the hyperlinks.

Then use a random number routine that will return a number within the range
of numbers in your table. Use the returned number to retrieve the record
with the matching number.

This code will return a number between 1 and 20:

Randomize
intNewNumber = Int((20 * Rnd) + 1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top