Update Subform Datasheet Record from Main Form

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date 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
 
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
 
Back
Top