My Assistant
![]() ![]() |
|
|
May 5 2012, 09:40 AM
Post
#1
|
|
|
UtterAccess Guru Posts: 667 From: Singapore |
HI. very disturbing problem. I have an Order Table [OrderID] attached to an OrderProcess Table [OrderProcessID]. Users always create duplicates OrderProcess, sometimes two to three duplicated OrderProcess ID [blanks included] . This caused confusion in the Order Processing Dept. Any "bullet-proof" codes to prevent this?
|
|
|
|
May 5 2012, 09:49 AM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 47,914 From: SoCal, USA |
Hi,
What is considered a "duplicate?" How do the users manage to create them? Are you using a form for data entry? Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
May 5 2012, 12:32 PM
Post
#3
|
|
|
UtterAccess Guru Posts: 667 From: Singapore |
HI DBguy. Yes I have a frmOrderProcess linked to frmOrder via OrderID. User create a frmOrderProcess from a commandbutton in the frmOrder. I transferred the OrderID from the frmOrder into the frmOrderProcess. User without knowing there is a form already opened create another blank form with the same OrderID, thus a duplicate. is created. Possible to have codes to check whether OrderID in tblOrderProcess is greater than 1?
|
|
|
|
May 5 2012, 12:50 PM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 47,914 From: SoCal, USA |
Possible to have codes to check whether OrderID in tblOrderProcess is greater than 1? You mean something like? If DCount("*", "tblOrderProcess", "OrderID=" & Me.OrderID)>0 Then 'duplicate Else 'new End If Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
May 5 2012, 01:09 PM
Post
#5
|
|
|
UtterAccess Guru Posts: 667 From: Singapore |
Hi DBguy, Thats what I want, simple and sweet. Thanks again.
|
|
|
|
May 5 2012, 01:35 PM
Post
#6
|
|
|
Access Wiki and Forums Moderator Posts: 47,914 From: SoCal, USA |
|
|
|
|
May 6 2012, 01:54 PM
Post
#7
|
|
|
UtterAccess VIP Posts: 1,875 From: UK |
you could also add a unique key to the orders table, then access will prevent duplicates being inserted
|
|
|
|
May 26 2012, 08:59 AM
Post
#8
|
|
|
UtterAccess Guru Posts: 667 From: Singapore |
That's interesting, how do you add a unique key to the Order Table to prevent duplicates? Appreciate your help.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th May 2013 - 01:59 AM |