Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Checking for duplicate names in record creation

Posted on 2011-10-03
Medium Priority
Last Modified: 2012-05-12
I have a form called “Patient” which is used to add new patients to the database.  I have a vba code in my “Before Update” event of the form that checks the “Last Name” and “DOB” for duplicates before adding the new patient. Due to historic data that has been loaded to the patient table, there are patients that don’t have date of birth (DOB) and as a result of that I have to change the code used for checking  duplicates. I want the VBA to only check “Last Name” if the “First Name” & “DOB” are null but can check the other fields “UTSW MRN” or “Parkland MRN” if not Null. For example if a patient “Last Name” is entered without a “first name” and “DOB” but a “UTSW MRN” is entered that matches that last name and MRN with an existing patient, a message box should display saying there is a similar record in that database.  How can I accomplish this goal. Attached is a copy of my database with the form. Thanks in advance.
Question by:Chrisjack001
  • 2
  • 2
LVL 13

Accepted Solution

Lucas earned 2000 total points
ID: 36905147
Look at the attached database so you can get an idea.   But basically i created 3 functions that would check for your duplicates which you can change.  Remember this is just an idea.

Each time the value changes on the patient form, the before update event on the control will check for a duplicate.

LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36906219
As lucas911 will tell you, systems like this can start to slow down the DB, if you start having to check more fields and as the number of records grows.

Consider frontline techniques like making certain fields required.
My business is mostly Medical.
In a medical DB, there should not be an allowable reason for a patient's DOB to be blank.
For example, even in an emergency situation, the DOB is "approximated", butt never left blank.

The issue with using "Other fields" is that it just complicates things unnecessarily...

Just my 2c

Author Comment

ID: 36910733
You are absolutely correct boag2000. The only problem with these records are the patients are not required to provide all this information because they are used for research purposes. Example all the historic data we have to be uploaded are missing DOBs, Some first names etc.
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36910825

Just an fyi...

Author Closing Comment

ID: 36911116

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

564 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