generate random number

A

anitra

I already have a form that populates the orders table, the order number
field(O_Num) use to be keyed in,

this field also is the primary key and I cant use autogen because they
already have a field with autogen for this table.

they now want it to create a random number for O_Num when entering a new
record. I tried putting the following in the OnClick =Int((1000 * Rnd()) +
1) I believe that says pick a random number from 1-1000, which would be
plenty, but this didnt work, I am kind of a novice and not sure how or where
to put the code when I search the forum for help with genterated numbers.

I am in desperate need!!!!!!
Someone Please Help!!!!!!!!!!!!!!!!!!
 
S

simon

SteveS said:
I just ran across this site (again) and saw a couple of pages on random
numbers:

http://www.fontstuff.com/vba/vbatut05.htm#randomnumbers

and

http://www.fontstuff.com/vba/vbatut06.htm



Also, Roger Carlson's site has an example mdb about random records.... not
sure if it has anything about generating them.

http://rogersaccesslibrary.com/download3.asp?SampleName=RandomRecords.mdb


HTH

Not too sure if you still need help I have some code that generates
numbers...

Please let me know
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top