Results 1 to 2 of 2
  1. #1
    khhess is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    11

    Check if record exist


    I'm lost!
    How can I check with VBA if a record exist?
    I have two tables, one is tbl_SO and tbl_WO, both are in relationship.
    How do I check if a record in tbl_WO are in relationship with a record in tbl_SO?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Which is parent and which is child in the relationship?

    You can either use a recordset or DLookup function. If you are looking for one specific record, then with DLookup:

    If Not IsNull(DLookup("ID", "tbl_SO", "ID=" & inputID)) Then
    MsgBox "Record Exists"
    End If.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Append if record doesn't exist
    By Lorlai in forum Queries
    Replies: 1
    Last Post: 06-14-2011, 06:38 PM
  2. check data if exsists the add new record
    By joemills62 in forum Programming
    Replies: 18
    Last Post: 06-13-2011, 04:39 PM
  3. If record does not exist, open add new record form
    By RobertIngles in forum Programming
    Replies: 2
    Last Post: 02-01-2011, 08:47 AM
  4. Check if value exist in a table
    By Lucas83 in forum Programming
    Replies: 2
    Last Post: 06-02-2010, 11:42 AM
  5. Apply check at record level
    By wasim_sono in forum Programming
    Replies: 1
    Last Post: 04-19-2007, 07:48 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