Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rand a floating number in MS Access

 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
Does any body know how can I Rand a number in MS Access?
Thanks,
Elahe :roll:
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic