Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

invoiceID duplicates when 2 users key in the same time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Syphonics - 22 May 2008 16:46 GMT
I have this statement in my order form.
Before insert function:

Private Sub Form_BeforeInsert(Cancel As Integer)
  Me.InvoiceID = Nz(DMax("InvoiceID", "Orders"), 0) + 1
End Sub

This function will increase the invoice number each time I insert an order.
But there will be duplicates when 2 or more stations conicidently insert an
order at the same time.
I required this InvoiceID to be unique, no duplicates. Is there a way to
prevent duplicates?
Douglas J. Steele - 22 May 2008 17:17 GMT
Are you actually running into problems, or are you just afraid that you
might?

The probability of two people hitting Enter at exactly the same time is
usually extremely low, so that I wouldn't expect a problem to occur.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have this statement in my order form.
> Before insert function:
[quoted text clipped - 10 lines]
> I required this InvoiceID to be unique, no duplicates. Is there a way to
> prevent duplicates?
Syphonics - 23 May 2008 09:38 GMT
Thanks, I guess I have to set the table properties to no duplicates.

>Are you actually running into problems, or are you just afraid that you
>might?
[quoted text clipped - 7 lines]
>> I required this InvoiceID to be unique, no duplicates. Is there a way to
>> prevent duplicates?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.