Input parameter for append query

A

Andreas

I am designing an append query that will read data from one table and append
to the other. That will be triggered from within the form so, I want to use
the primary key of the currently displayed record as criteria.
1) How do I define this in the criteria option of the append query?
2) What code do I need to use on my trigger in the form, in order to open
this query and pass the value of the primary key as parameter to the query?
 
B

Baz

Lets' assume that the form is called frmSomething, and that the primary key
field is called some_field. Your criteria expression would look like this:

WHERE some_field = [Forms]![frmSomething]![some_field]

Assuming your query is called qrySomething, your code would simply be this:

CurrentDb.Execute "qrySomething", dbFailOnError
 

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