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

Unique Identifier 1

Status
Not open for further replies.

benderulz

IS-IT--Management
Nov 2, 2010
43
US
I have a table that contains a record for PO# 12345, the same PO arrives again and a new records needs to be inserted into the table, but since the PO# is the unique identifier I need it to be inserted as something like 123451. Is it possible to have Access check for the PO, if it already exists in the table, add a digit to the end before inserting it into the table?
 
??? Why is the same PO, or a second PO with same unique number, arriving to you?
 
Ok that makes sense. I append to the holding table, run the update so if the PO is not null in the "real" table it updates to [PO]&"1".

Now, is there a way to make it update to the next available number in the case that there was a backorder already on the table, or do I have to step it through again and again. In some cases our vendors send multiple backorders for the same PO, so the PO number could read anywhere from 12345 to 123459.
 
I think I figured it out. I ended up writing additional updates that run after the original but use the Update To of Left([PO],5)&"2" and so on before I append to the table and clear the holding table.

Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top