|
1. question
when i have custom autonumber field... like Nz(DMax("ClanID",
"tblClanovi")+1 how can i make it try again if someone else pressed the save
button and that namber is already taken,..?? this i need for let say
multiple users running the frontend in access 2002/3 aplication and making
invoices (invoice number is uniq number... and it should only be generated
after presing a save and print button...) now i'm using this code but in
testing phase while i'm building the app it works but i know it wont work as
it should in production enviroment...
me!txtInoviceNo = Nz(DMax("InoviceID", "tblInvoices")) + 1
DoCmd.RunSQL ("INSERT INTO tblInvoices (InoviceID, SomeValue) VALUES (" &
Nz(DMax("InvoiceID", "tblInvoices")) + 1 & "," & "'" & Me!txtSomeField& "'"
& ")")
2. question
after using the same line of code how can i get the value of access (2002)
autonumber after insert into...
so when i append a record it gets its id ... i need this for one of my old
aplication.. that i'm rebuilding but i cant change the way its done on sql
server.. it hase to stay the same..
i need id of this field to print a report with that id -.... |