jQuery in Action, 3rd edition
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 Introducing JavaFX 8 Programming this week in the JavaFX 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

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?
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
It's not a secret anymore!