|
-
May 25th, 2001, 11:42 AM
#1
Ramdomising
Hi There,
I have a number of questions within an Access Database which get read onto a VB front End (I am developing a Quiz). I would like the questions to be provided in a different order each time the program is run - Is this possble???
Thanks
-
May 25th, 2001, 12:08 PM
#2
PowerPoster
Here's a way. You could randmoize the primary key, basically using a select statement, and fetching the records this way. Does that make sense??
-
May 25th, 2001, 03:00 PM
#3
Re: Ramdomising
Originally posted by rlculver
Hi There,
I have a number of questions within an Access Database which get read onto a VB front End (I am developing a Quiz). I would like the questions to be provided in a different order each time the program is run - Is this possble???
Thanks
I am assuming that you have a next button, or something to go to the next Question, or something similar. You can have a unique key, and load all the keys into a collection
Dim Col as Collection
Dim X as Long
set Col = new Collection
if not rs.bof or rs.eof
rs.movefirst
do until rs.eof
col.add(rs.keyfield)
loop
end if
do until X >= 1 and X<= Col.Count
x = rnd * Col.Count
loop
RS.MoveFirst
RS.Find "KeyField = " & Col(X)
display question
-
May 29th, 2001, 12:10 PM
#4
Sorry I dont quite understand what to do
-
May 29th, 2001, 01:27 PM
#5
Please HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|