wood burning stoves 2.0*
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


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.
 
Don't get me started about those stupid light bulbs.
 
subject: Rand a floating number in MS Access