Input parameter for append query

  • Thread starter Thread starter Andreas
  • Start date Start date
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?
 
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
 
Back
Top