Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique numbers in Purchase Orders

Status
Not open for further replies.

yogiyosh

Technical User
Oct 13, 2003
14
GB
I am using Word 2002 for my commercial Purchase Orders. I would like to add a unique order number to a form when it is saved or opened, is there a solution to it???
 
Do you store the values in a database? If so you could use a unique id assigned to that record.

If not, do your users log into your system? If they do you could use something like their username and the current date/time.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
I don't think I explained v.well!! My system works like this: C00xx. Obviously each new p/o increases the value of xx by one. So the idea would be to generate a new number on opening or saving the document. Sorry for being unclear!!
 
No probs. If you do use a database you could still do it the same way i.e the ID field starts at 1 and increments by 1 each time. Each time a new order is placed you write it out to the word file as:
Code:
OrderNumber = "C0" & rs("ID")
where id is the value of the record in the database.

If you don't use a database then that is still OK but you will have to decide where you store this number (it has to be somewhere where it can be read and updated). Possibilities are a registry entry (you read it, assign it to the order and then update it to add 1 to its value) or maybe even a text file (same scenario as above).

No matter which way you do it, the procedure of doing it is basically the same, it's just up to you how you prefer to do it.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
2 ca8msm. Thanks a lot you've been a great help, this should resolve the conflicts with other users. All the best.
 
Which ever way you attack this, I recommend you put trapping code to deal with someone else trying to amend the record / text file at the same time.

mmilan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top