Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2014

    Unanswered: flag Duplicate records

    I want to alert my users if they begin entering a record that already exists. I need to evaluate two fields as NameFirst&NameLast at the NameLast_AfterUpdate() event and alert user to verify if this is a new person with a like name or if it is an existing record. Cannot use DOB or SocSec# because that info normally comes days later. I can find duplicates after they are entered, then correct, but would rather catch it before it happens. Can a simple piece of code accomplish this task? Thanks- David

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    theres several ways to do this

    use the dlookup function to find if there are duplicate rows. either i the controls before update event OR the forms before update event. if you place code int he cotnrols before update event you'd need to test that there are values for the forename and surname. heck you'd have to do that anyway if you used the forms before update. the code would be something like

    if isnull(dlookup("DoB", "MyTable", "NameFirst = '" & ctlNameFirst & "' and NameLast = '" & ctlNameLast & "'")) then
      'we didn't fidn the specified firstname and last name combination
      'insert your code here to handle that eventuality. may need to set cancel = true to force the update to fail
    you will need to change the name of the table (mytable) and the controls ctl... to match what you are using

    you could open a pop up displaying pre exisitng records which match
    you could get a bit fancy and use soemthign like Double Metanome or Soundex to find close matches and try to identify rows which are similar but not the same due to typos
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts