Results 1 to 5 of 5

Thread: Ramdomising

  1. #1
    rlculver
    Guest

    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

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    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??

  3. #3
    rickm
    Guest

    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

  4. #4
    rlculver
    Guest
    Sorry I dont quite understand what to do

  5. #5
    rlculver
    Guest
    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
  •  



Click Here to Expand Forum to Full Width