Avatar of Chrisjack001
Flag for United States of America

asked on 

Checking for duplicate names in record creation

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.
Microsoft AccessDatabasesMySQL Server

Avatar of undefined
Last Comment

8/22/2022 - Mon