Run Update Query for current record

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have button on my form that runs an Update Query. However I want to limit
the query to only run based on the current record on the form. How would l
best handle this issue?
 
V

Van T. Dinh

If you have some Field on the Form that can uniquely identify the Record,
you can use this as the criteria in your Update ... something like

CurrentDb.Execute "UPDATE ..... SET .... " & _
"WHERE [IDField] = " & Me.IDField, dbFailOn Error

(assuming a numeric IDField).

Is your Form updatable? If so, you may create conflicts since you update
the same record via the Form and the Update SQL.
 

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