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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to create a 'Confirm' button

Status
Not open for further replies.

pfenton

Technical User
Jul 18, 2000
32
GB
The data in the d/b I've created is uniquely numbered.
(ie) document number needs a unique value for each document!!
So when someone adds a new record, anywhere on the server, there needs to some sort of command button which will confirm that the new number is unique (I'm not using AutoNumber - too awkward for queries!)
Any ideas on the sort of code or command I might need to do this and prevent me from getting into deep poo-poo!!
 
The problem you are having is the reason why you should generally use autonumbers. I'm not sure what you mean by "too awkward for queries", but I would STRONGLY recommend that you reconsider using autonumbers.

OK, I'll get off the soapbox....It sounds like you have a multiuser database set up, with many users able to add records. You need to make sure any record added is assigned a new, unique value. If this is the situation, one way to do it is to create a function. You would need some code (use SQL or a lookup) to find the current max of the document ID, then add one to it and return the new ID. When a user does whatever is necessary to add a new document, you would lock the table that holds the document ID, run your function, get the new ID, and unlock the table.

Does that sound like what you are looking for?






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top