DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Location
    UK
    Posts
    8

    Red face Database & Random Numbers

    Hi everybody
    I am hoping somone can help me with this problem for college.

    I have a database in Access and I need to extract Random records for a quiz. The way that I have done the random does work with the database as it is, but we have to allow the player to add to the database from the quiz which I have also been able to sort out.
    My problem is that I don't know how to write the code so that the random takes into consideration all the records and not just the original ones.

    My database currently has 111 records and I have used that for the randomize - RndNo = Int(Rnd * 111) + 1 - and it works fine, but I could end up with 120 + records.

    I tried using UBound and LBound but just made a mess of it.

    Can anybody help please, this assignment is finished but for this.

    Suze
    Suze

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    instead of hard-coding the number 111 in your code use recordset.recordCount
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Aug 2004
    Location
    UK
    Posts
    8

    Smile

    Thanks Marco

    I will give that a try

    Suze
    Suze

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links