Conditional Append Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • irsmalik
    New Member
    • May 2010
    • 102

    Conditional Append Query

    Help to create conditional Append Query

    Hello friends,
    I am new in MS Access database and I need your help

    I want to create Append Query. Before adding new record, query should check the values of a field. If the same value already exist, Query should not Run.
    Otherwise, it should append the record. For example I have 2 tables

    Table A has field CustomerID, Name, Phone, Address
    Table B has CustomerID, InstalmntNo, InstalDate, InstalAmount

    Data entry form is based on a query. After Data entry, there is a Command Button which runs the Append Query

    Now if the InstalmentNo is already exist, query should not add new record, other wise it should run and add a new record.

    Can any one help me. Thanks in Advance
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Outer Join the table and insert only those where the record doesn't exist, ie null.

    Comment

    • irsmalik
      New Member
      • May 2010
      • 102

      #3
      I do not understand.

      Comment

      • MikeTheBike
        Recognized Expert Contributor
        • Jun 2007
        • 640

        #4
        Hi

        If you are running the append on a button click, then use the DCount() domain function to check before you run the query?

        MTB

        Comment

        Working...