Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jun 2005
    Thanked 0 Times in 0 Posts

    Append Query (2003)

    I need to append data from two tables A & B into a third table C. I created two append queries so that all of the data from A & B would be joined into table C. I want people to be able to hit a command button and view the data in table C. My question is, is there a way for the append queries for A & B to automatically run or is there vba code for this to occur when the command button is run for table C to be viewed?

    Thanks for your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Append Query (2003)

    You can use VBA code to run append queries. For example:

    Private Sub cmdSomething_Click()
    ' Suppress warnings
    DoCmd.SetWarnings False
    ' Run queries
    DoCmd.OpenQuery "qryAppendA"
    DoCmd.OpenQuery "qryAppendB"
    ' Show warnings again
    DoCmd.SetWarnings True
    ' other code goes here
    End Sub

    Note: if you want the code to warn the user that he/she is about to execute an action query etc., remove the two DoCmd.SetWarnings lines.

Posting Permissions

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