473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to restrict duplicate record in particular conditions

I have a form with three fields. Plate , KMS, and Status (Closed or AVL)

EXAMPLE
Record 1 when the Plate (1234) AND status= closed (DUPLICATE OK)

Record 2 when the Plate (1234) AND status= closed (DUPLICATE OK)
BUT
Record 3 when the Plate (1234) AND status= AVL (NO DUPLICATE )

can somebody help me
Dec 18 '14 #1

✓ answered by twinnyfo

Taloker,

You would have to do this in VBA, probably on an AfterUpdate Event for the text boxes and combo boxes that hold your data. If it meets the necessary criteria, save the record, if not, cancel the update.

2 963
twinnyfo
3,653 Expert Mod 2GB
Taloker,

You would have to do this in VBA, probably on an AfterUpdate Event for the text boxes and combo boxes that hold your data. If it meets the necessary criteria, save the record, if not, cancel the update.
Dec 18 '14 #2
jforbes
1,107 Expert 1GB
You could also put the validation in the Form's BeforeUpdate Event and if your validation fails, set
Expand|Select|Wrap|Line Numbers
  1. Cancel=True
to exit out of the event without saving the record.

Reference: http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
Dec 18 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same...
0
by: Cyberwolf | last post by:
OK, how to explain this. I have a table that will feed into another table using an append query. What I want to do is look at the table I am appending the record to to check for a duplicate...
1
by: 2D Rick | last post by:
Access2003 in XP If I open a form to a specific record and click on a command button with the following code I get a duplcate record: DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand...
6
by: planetthoughtful | last post by:
Hi All, I have a C# ASP.NET page that submits back to itself to insert details from a form into a database table. When / if the user refreshes the page (and gets the standard warning that POST...
6
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger",...
2
by: Ranma13 | last post by:
Hello, I have a duplicate record check written in VB for a check in/check out database. Here's the pseudocode, written for the BeforeUpdate property on the form: If DCount(search for records with...
3
by: Tempalli | last post by:
Iam using the below code to search the duplicate records in Ms Excel before uploading to Ms access. It is working fine but i want the msgbox to display that there is a duplicate record in...
1
by: ahmedahmed | last post by:
how to restrict duplicate values in msflexgridcontrol
2
by: newaccessuser13 | last post by:
I am relatively new to Access (2010) and I am having difficulties in making a duplicate record button that was created with the wizard work correctly. I have a very simple database and form. To...
2
by: yaozaah04 | last post by:
Hello, I am working on a data entry form using Microsoft Access 2010 and I am supposed to give the user a separate option to look for a duplicate record. However the duplicate record-checking works...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.