October 2, 200619 yr In our invoicing system, I stored a running invoice number in a field in a table. When user has completed entering the invoice, my script will go to this table and get this running number, and then increment this number by 1 before exit. In multiuser, we often encounter two invoices having the same invoice number. It looks to me two users happened to go to the same field and retrieve the same running number. I tried using Open Record to 'lock' the field but it does not work. This is giving us a big headache. Appreciate any help how to overcome this.
October 2, 200619 yr In general, I don't like this serial numbering technique because of the record locking issues, but I assume you have a good reason. If you post the script you're using to retrieve and increment the serial, maybe there's a way to work around it by doing more error trapping.
October 3, 200619 yr Author The code is very simple. I simple go to the layout, find that record and read the serial number field. I then increment that field before returning to the main program. I agreed with you this method is not ideal but I cannot think of other way. I am more than happy to change my coding, Appreciate you can share with me a better of way of handling this situation. Thank you
October 3, 200619 yr What is "this situation"? What prevents you from having an auto-entered serial number in the Invoices table itself?
October 3, 200619 yr Author Let me explain our situation. Our invoicing table is actually a general purpose 'billing' table. It is being used for Quotation, PreOrder and Invoicing. We have a field called TypeOfTransaction to differentiate between them. Each has its own running number. If user is doing quotation, then the so called "invoice number" field will store the Quotation running number and so on. As such we cannot make use of the auto-entered serial number. We stored all the running number in a separate table as I have described earlier. But we run into duplicate number especially for Invoicing.
Create an account or sign in to comment