Sorry. You did ask me to post the code. While I don't have it with me, the
code below is the basics of it. Just the 2 lines...
In the OnClick event, I have:
Docmd.RunSQL ("Update tblRecords set FieldA = txtFieldA where IDNumber =
txtIDNumber;")
[Forms]![PrimaryForm]![SubForm].Requery
Well, you'll need to do two things: save the current record on the
subform before you do this, and pass the value in txtFieldA rather
than its name to the query. Try
If Me.Dirty Then Me.Dirty = False
Docmd.RunSQL ("Update tblRecords set FieldA = '" & Me.txtFieldA _
& "' where IDNumber=" & Me.txtIDNumber & ";")
or (better) use the error-trappable Execute method:
Dim strSQL As String
Dim db As DAO.Database
Dim qd As DAO.Querydef
On Error GoTo Proc_Error
If Me.Dirty Then Me.Dirty = False
strSQL = "Update tblRecords set FieldA = '" & Me.txtFieldA _
& "' where IDNumber=" & Me.txtIDNumber & ";"
Set db = CurrentDb
Set qd = db.CreateQueryDef("", strSQL) ' create an unnamed query
qd.Execute dbFailOnError
Set qd = Nothing
Me.Requery
John W. Vinson[MVP]