Solved

Access 2103 Web App:  Prevent duplicate entries

Posted on 2014-09-06
2
820 Views
Last Modified: 2014-09-08
Grinding out an Access db upgrade to Access web app.  

Original PK in desktop db is now no longer the PK in web app., given the up-sizing uses the record ID as the PK.  May not have the experience for this upsize, but all seems well after some great advices at: http://www.ascassociates.biz/WebApp12_ConvertTables.aspx  Followed to the letter (especially the last paragraph on referential integrity) and all is well.

Now onward; user on data entry in the app., can create duplicates in the field that was the PK.  Minor issue since all still seem related correctly, but will be when running existing  reports on desktop.  The duplicates will deliver bad results.  What is best method to prevent user from creating a new record using an existing records pseudo PK field?

...or better put, ignoring the PK comment:  How to prevent user from entering duplicate data in a given field?
0
Comment
Question by:VirtualKansas
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40308500
Create a Unique Index on the table and include the fields that make that record unique. For example, if I have a Customer table, and want to be sure that the values of CustomerName + CustomerPhone + CustomerZip are unique, then I'd add those three fields to a Unique Index.

Web App Unique Index
0
 

Author Closing Comment

by:VirtualKansas
ID: 40310229
Hi Scott and thanks for reply.  My problem was actually simpler, but you lead me down the right path.  I only have one unique field requirement in the original db design.  Long story, but the original design didn't have table relationships, I added those later but failed to enforce the index/no duplicates on the field.  With your help, we simply applied the index rule and boom, got the result we're after.

Thank you for "Access 101" reminder.  As long as you agree with our method (even simpler than we thought), then case closed, with our thanks.

BTW; really appreciate your responsiveness.  EE in general has been surprisingly unresponsive, the last few weeks.  Been thinking twice about my subscription, but your help has made a bigger difference then you know and restored our faith.  TY
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some very basic things about SQL Server filegroups.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now