UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Prevent Duplicate Records, Office 2003    
 
   
foxtrojan
post 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?
Go to the top of the page
 
+
theDBguy
post 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)
Go to the top of the page
 
+
foxtrojan
post 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?
Go to the top of the page
 
+
theDBguy
post May 5 2012, 12:50 PM
Post #4

Access Wiki and Forums Moderator
Posts: 47,914
From: SoCal, USA



QUOTE (foxtrojan @ May 5 2012, 10:32 AM) *
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)
Go to the top of the page
 
+
foxtrojan
post 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.
Go to the top of the page
 
+
theDBguy
post May 5 2012, 01:35 PM
Post #6

Access Wiki and Forums Moderator
Posts: 47,914
From: SoCal, USA



Hi,

(IMG:style_emoticons/default/yw.gif)

Glad we could help. Good luck with your project.
Go to the top of the page
 
+
gemmathehusky
post 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
Go to the top of the page
 
+
foxtrojan
post 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 the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 01:59 AM

Tag cloud: