By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 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
Hi

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
ColumnA

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

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


NeoPa
Expert Mod 15k+
P: 31,186
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.