Results 1 to 8 of 8
  1. #1
    pattrickcolin is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    southend on sea
    Posts
    44

    Append Query Button on a form

    I have a split form where I would like to place a button that starts an append query.



    I need to set the 'OnClick' properties to achieve this, but do not know the syntax?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Do you want to use macro or VBA?

    I use only VBA.

    Select [Event Procedure] in the event property then click the ellipsis (...) to open VBA editor - type code.

    CurrentDb.Execute ("your query name or an sql statement here")
    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.

  3. #3
    pattrickcolin is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    southend on sea
    Posts
    44
    Thanks for your reply.
    I now get error message 424.

    Private Sub Run_update_Click()
    CurrantDB.Execute "ImportedBankTransactions Query"
    End Sub

    Where "ImportedBankTransactions Query" is the name of the Append Query

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Enclose in () as shown in example.
    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.

  5. #5
    pattrickcolin is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    southend on sea
    Posts
    44
    Thanks for your reply
    However even with the brackets:-

    Private Sub Run_update_Click()

    CurrantDB.Execute ("ImportedBankTransactions Query")
    End Sub

    I still get error 424 Object required

    My database knowledge is poor, so what is required.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Perhaps correct spelling of CurrentDB.
    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.

  7. #7
    pattrickcolin is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    southend on sea
    Posts
    44
    da!! thats a silly mistake.
    Thankyou for your time, it worked, thankyou.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Be sure to run Debug > Compile after code edits.
    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. Replies: 11
    Last Post: 11-19-2013, 03:38 PM
  2. Using a form to create an Append query?
    By Access_Novice in forum Forms
    Replies: 6
    Last Post: 10-04-2013, 11:39 AM
  3. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  4. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  5. Replies: 1
    Last Post: 01-20-2010, 12:54 PM

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