Update Subform Datasheet Record from Main Form

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

mattc66 via AccessMonster.com

Hi All,

I have a main form combo box that I would like to set the After Update event
to change all the records in the subform to match this value.

Dim rst As Object

Set rst = WHAT DO I TYPE HERE???
Do Until rst.EOF
rst.MoveNext
Loop
 
D

Douglas J. Steele

It would be far better to run an Update query, rather than looping through a
recordset.

In almost every case where you have both alternatives, using SQL will be
considerably more efficient.

I'd use:

Dim strSQL As String

strSQL = "UPDATE MyTable " & _
"SET MyField = " & NewValue & _
" WHERE ...."

CurrentDb.Execute, 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