Send query results to table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I wanted to replace the values of certain fields in a table with the
results of a query when you click a button on the form using the table, how
would my syntax look? This is where I am now:

docmd.runmacro ("qryname")

me.tablefield = me.qryname.field

Does anyone know what I'm doing wrong
 
On the on click event of yhe button use the code
If the form is bounded to the table, and you located on the right record
then assign the value from the query to the field in the form

me.FormFieldName = dlookup("FieldName","QueryName")

If you want to update a field in a table that has no connection to the form
where the button is, then run an update query.
 
Back
Top