This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes General Computing and the fly likes Rand a floating number in MS Access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Rand a floating number in MS Access" Watch "Rand a floating number in MS Access" New topic
Author

Rand a floating number in MS Access

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Hi Friends,
Does any body know how can I Rand a number in MS Access?
Thanks,
Elahe :roll:
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

You can make an AutoNumber field produce a random number (in design view, select the row, and make the type 'AutoNumber' and at the bottom, select 'New Values = Random'

If it *must* be a float, or if you're wanting a number at some other time than row insertion, you could use VBA to produce a random number. It's been too long since I worked in VBA, so I can't help you with that code, but I know it's possible. Add a new module, and hope that your Access install has the VBA help files installed, if you're not sure of VB yourself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rand a floating number in MS Access
 
Similar Threads
WA #1.....word association
JDBC & SQL Error List Help
database in netbeans
How to get next available number from MS access
Random insert and delete into an arraylist