By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,574 Members | 2,966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,574 IT Pros & Developers. It's quick & easy.

How to Prevent insertion of duplicate values in Access DB based on two or more column

P: 1

Am novice to Access DB querying

My scenario is

ColumnA ColumnB
A 1 Already Inserted

A 1 Should not allow as the same
values exists already

A Null Should allow to insert as the values
in one ColumnB is NULL

B 1 Should allow to insert as the values
in one ColumnA Mismatch and ColumnB
matches Priority is for ColumnA
same values should not exist in

A 2 Should not allow to insert as Values in
ColumnA Already exist and Also ColumnB
values does not match

Kindly help me with the code needed in Access DB and also advise me whether to retrieve the values in excel VBA and Validate these criteria's or to validate in Access DB itself

if i validate in Variables in Excel VBA how to store the column variables in Excel variable and validate each record as the query will retrieve multiple records

Kindly help me with the code needed

Prabu M
Feb 25 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,494
Unique indexes can be made up of multiple fields. This should be all you need to ensure no multi-field duplications.
Feb 26 '12 #2

Post your reply

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