execute a query

I

iccsi

I wanted to execute an append query

I tried to use docmd.openquery which open the query, but does not
append the records.


Any way using VBA to execute an append query?

Your help is great appreciated,
 
J

John W. Vinson

I wanted to execute an append query

I tried to use docmd.openquery which open the query, but does not
append the records.


Any way using VBA to execute an append query?

Your help is great appreciated,

At least two:

DoCmd.RunSQL "INSERT INTO..."

or, better because it traps errors and doesn't give you a nag prompt warning
that you're about to run a query that will modify data:

Dim db As DAO.Database
On Error GoTo Proc_Error
Set db = CurrentDb
db.Execute "yourqueryname", dbFailOnError
Proc_Exit:
Exit Sub
Proc_Error:
<do your error handling here>
Resume Proc_Exit
End Sub
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top