Access Library (1 Viewer)

AlyKatVandy

New member
Local time
Today, 16:28
Joined
Jul 5, 2019
Messages
2
Greetings! I've been playing around in Access trying to make a record of all the books in my library. I've gotten it mostly completed but I'm having trouble with a button in a form. My goal is to be able to click the button and it will pull a random record from my "UnreadAll" query. Any ideas?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:28
Joined
May 7, 2009
Messages
19,229
for starter you need to create a random number generator (search the net - vba random generator).
you also need an autonumber to be included in your query.
then you can pull the record from your UnreadAll query by using dlookup or select query, which ever you prefer.

select * from UnreadAll where ID = fnRandom();

dlookup("ColumnToReturn", "UnreadAll", "ID = " & fnRandom()
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:28
Joined
Oct 29, 2018
Messages
21,454
Hi. Welcome to the forum! Have a look at this. Good luck!
 

Users who are viewing this thread

Top Bottom