I have a subform on a form and they are not linked. On the main form is
a text box where the user types in a number. When that number changes,
I have some code to make the corresponding text field in the subform
default its value so that the next record created uses the value from
the box on the main form. So far so good - works fine.
What I also need to do at the same time is change all *existing* records
on the subform to that same value. I am trying to do this via editing
the recordsetclone, but nothing seems to change - how do I write changes
made to that to the real recordset? Existing code listed below.
Thanks,
Private Sub txtMarks_AfterU pdate()
Me.Subfrm_Produ ctionData!txtMa rks.DefaultValu e = Me.txtMarks
Dim db As Database
Dim rst As Recordset
Set rst = Me.RecordsetClo ne
With rst
.MoveFirst
Do While Not .EOF
.Edit
!Marks = Me.txtMarks
.Update
.MoveNext
Loop
End With
Me.Subfrm_Produ ctionData.Reque ry
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Comment