472,958 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Help with duplicated Entries.

1 Bit
Greetings...
I'm looking for help; is there a way to allow "certain" duplicate entries in an Access table and still be able to restrict others?

I have a entry access database for tracking visitors. On the access table itself, there's a column for a visitor badge numbers. However, since that column is indexed and won't allow duplicates. How do I allow exceptions for certain badge numbers/names, that need to be duplicated?

And yes, this table is fed from a form; which all information then creates a report "our entry access list". Our visitor badges have a unique 4-digit number. Which the user would enter in the form. If the same number is entered more than once, then yes, that index control prevents the user from entering a badge number that's already assigned to another visitor.

However, if a visitor doesn't have an assigned badge with a unique number, they're issued a TEMP. I'd like to be able to use the word "TEMP" for more than one record, and still restrict entering a duplicate badge number already assigned .
Feb 18 '21 #1
5 2049
NeoPa
32,547 Expert Mod 16PB
So, you want the design of the table to restrict some duplicates but not others? I hope it won't be a surprise to you to know that table design doesn't allow for that. Unique or not are the options.

You could cheat and assign a negative number for TEMP badges and then ensure your badge-printing report replaces any negative number with the string "TEMP". You could do all sorts of clever things, but don't expect a database to restrict values in one range to being unique while allowing others to be duplicated.
Feb 18 '21 #2
ADezii
8,834 Expert 8TB
You may be able to accomplish this by creating a Before Change Data Macro in the Table that contains the Badge Number Field. The pseudo-logic would be if the status of the individual = 'TEMP', allow the Duplication, otherwise do not allow. Just a few points to mention:
  1. The Duplication Logic for the Before Change Data Macro would propagate to the Form whose Record Source is the Table containing the Data Macro.
  2. The minimal Version for using Data Macros is 2010.
  3. You would have to allow Duplicates on the [Badge] Field in your Table, the Macro would control whether or not a Badge can be duplicated.
P.S. - I am at work right now, and cannot test this Theory since I only have Access 2007 here.
Feb 20 '21 #3
NeoPa
32,547 Expert Mod 16PB
Are you sure you want to complicate this further my friend? Remember the KISS Principle ;-)
Feb 20 '21 #4
ADezii
8,834 Expert 8TB
Not al all, NeoPa, but weren`t you the one who said `you could do all sorts of clever things,` Simply wanted to imply that it may not be the end of the road for the OP. Please feel free to Delete the Post, I always trust your judgement in these matters.

By KISS do you mean Keep Implying a Secondary Solution? (LOL).
Feb 20 '21 #5
NeoPa
32,547 Expert Mod 16PB
Clever things are good if they get you a better solution. My impression of this is extra complication for a less beneficial result.

Start with a basic concept of uniqueness. Allow the database to help you in that respect. From there you can use that managed data to provide a report that matches your requirements.

NB. No. I won't be deleting the post of a respected friend - or indeed anyone else either - simply because I don't agree with where they're going.

And, you make a good point that there are more options available if you think outside the box.
ADezii:
By KISS do you mean Keep Implying a Secondary Solution? (LOL).
NO! Of course not. BUT - it did make me laugh :-D
Feb 21 '21 #6

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

Similar topics

2
by: Keith | last post by:
I am having a problem creating a many-to-many-to-many type relationship. It works fine, but when I create a view to query it and test it, it does not generate the results I expected. Below...
0
by: GlobalBruce | last post by:
The GAC on my development computer has several assemblies which are duplicated. For instance, the System assembly is present as two different native images as well as the non-native version. The...
1
by: Mr. B | last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db We have a commercial program that does our Acounting and Time Sheets (Timberline). At least once a day our Accounting department runs a Script...
6
by: Ryan Liu | last post by:
Hi, If I have tens of thousands DataRow in a DataTable and allow the end user to pick any DataColumn(s) to check for duplicated lines, the data is so large, is there a better API, algorithm can...
1
by: kjones12 | last post by:
Not sure of the best way to do this, but here is what I am shooting for. Basically, I am creating a DB for Project Management. I want the co workers to be able to make comments, and update those...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
7
by: bhipwell via AccessMonster.com | last post by:
Hello, I have developed an employee benefits database that currently contains over 3000 employees and 70+ companies. Having started the database as a really simple solution for our clients, the...
2
by: adigga1 | last post by:
Good Day Experts, I have an issue dealing with a subform operation whereby, each time I select the value field of the subform, that same value is then placed into the source table as a new...
2
OuTCasT
by: OuTCasT | last post by:
I have a table with duplicated entries. How could i return the single rows of each record so i can get rid of the duplicates. Or how do i remove duplicate entry rows ?
1
by: irishman211 | last post by:
I apologize in advance, I'm trying to teach myself python in my spare time since I was assigned this task. I am working on a way to examine a directory of thousands of files looking for common...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.