Update a different table with form data

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

Guest

How do I update a second table with data being changed on a form driven by
the first table? Basically I'm trying to create a log. When the user opens
the filtered data in the pop up form, they can change a field. when they
submit, the data updates the first table, but I'd also like it to update a
second table. I wrote this line:
Tables![tblMoveLog]![MoveTo] = Me![Combo9].Value

But I get an error stating "Object Required"

Help please
 
How do I update a second table with data being changed on a form driven by
the first table? Basically I'm trying to create a log. When the user opens
the filtered data in the pop up form, they can change a field. when they
submit, the data updates the first table, but I'd also like it to update a
second table. I wrote this line:
Tables![tblMoveLog]![MoveTo] = Me![Combo9].Value

But I get an error stating "Object Required"

Help please

I don't know where you got the Tables! notation - it certainly does
not exist in Access.

You'll need to open a Recordset based on the table, and either move to
a selected record or use the AddNew method on the recordset to create
a new record:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblMoveLog", dbOpenDynaset)
rs.AddNew
rs!MoveTo = Me!Combo9
rs.Update
rs.Close
Set rs = Nothing

John W. Vinson[MVP]
 
Back
Top