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?
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?
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.
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
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.
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.
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.
da!! thats a silly mistake.
Thankyou for your time, it worked, thankyou.
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.