|
|
#1 |
|
New Member
Join Date: Feb 07
Posts: 2
![]() |
random number generator to get an item from access
hi Everyone,
I am trying to write a programme for a membership draw. I have created a membership database with 360 members. What I want to do is get VB to pick a random number from 1 to 360, then go to the database and then display what the field is located at that number. I have created the database so that there is a "number Record" as the key. ie if VB selects 60, I want VB to show what information is at record number 60. I have looked through the forums for an answer, but cant quite find what I am looking for. Hope someone can help |
|
|
|
|
|
#2 |
|
Frenzied Member
Join Date: Jun 05
Posts: 1,465
![]() ![]() |
Re: random number generator to get an item from access
Welcome to VB forums.
Checkout the link: How to generate a random number, in between two given values
__________________
CS. Code Snippets: • Check folder exists (in four ways) • Check file exists (in Six ways) • Read text file contents (in four ways) • How to write text in a given text file (in two ways) • Rename files (in four ways) • List all installed apps • Use WinZip to zip and unzip files • Read and Write INI files • How to find Mother boad Serial Number |
|
|
|
|
|
#3 |
|
Frenzied Member
Join Date: Jun 05
Posts: 1,465
![]() ![]() |
Re: random number generator to get an item from access
what is your database structure?
__________________
CS. Code Snippets: • Check folder exists (in four ways) • Check file exists (in Six ways) • Read text file contents (in four ways) • How to write text in a given text file (in two ways) • Rename files (in four ways) • List all installed apps • Use WinZip to zip and unzip files • Read and Write INI files • How to find Mother boad Serial Number |
|
|
|
|
|
#4 |
|
New Member
Join Date: Feb 07
Posts: 2
![]() |
Re: random number generator to get an item from access
Database structure is:
Field 1 - Number Field 2 - Surname Field 3 - Given Name All I need it to do is randomly select a number, then display first and given name |
|
|
|
|
|
#5 |
|
Frenzied Member
Join Date: Nov 05
Location: Cheshire, UK
Posts: 1,467
![]() ![]() |
Re: random number generator to get an item from access
Heres how to get a random between two values:
VB Code:
@cssriraman that function you posted returns a variant and tries to emulate a simple loop by using Goto labels!
__________________
Chris Codebank: Easy Javascript Form Validation (OOP) If this post helped please rate it! |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|