Results 1 to 2 of 2
  1. #1
    twbeacham is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    1

    How to check if the first and last name already exists

    I have a form used to enter new contacts. I would like to insert a query or macro that would automatically to see if the name (first and last) already exists in the table to which this form is attached. If the name exists, I want to open the existing record and add information to it. If not, I want to enter the information as a new record.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Check the DCount() function. http://www.techonthenet.com/access/f...ain/dcount.php

    If DCount( proper arguments) > 0 Then
    'name already exists
    'your code to open that record and update it
    else
    'name doesn't exist
    'your code to enter the record
    end if

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Check if record exists, Check Number
    By burrina in forum Forms
    Replies: 9
    Last Post: 01-06-2013, 03:49 PM
  2. How to check if Table already exists
    By riaarora in forum Access
    Replies: 1
    Last Post: 08-12-2012, 09:48 AM
  3. Replies: 1
    Last Post: 06-26-2012, 03:06 AM
  4. Trouble with check if Exists before Edit or Add Record
    By mrfixit1170 in forum Programming
    Replies: 4
    Last Post: 02-10-2012, 10:38 AM
  5. How to check if a node of a tree exists
    By weekend00 in forum Programming
    Replies: 2
    Last Post: 10-27-2010, 09:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums