save recordset of subform

  • Thread starter Thread starter peg
  • Start date Start date
P

peg

I have a form that has a subform (which then also has a couple subforms in
it)

On the 1st subform i have a button to print a report based on the info in
the subform.

My problem is if they just enetered or updated the data i can't get it to
save before it goes to print.

In the print command button code I placed: me.recordset.update but that
didn't do anything.

also tried this:

Set frm1 = Forms("ProgressNote")
Set ctl1 = frm1.Child6
ctl1.Form.Recordset.Update

that didn't do aything either.

Anyone have any ideas?? THANKS!!
 
Probably i haven't well understood what do you need, but..
if the data are entered in the same subform where there is the "print" button, just as debugging test, try this
place this code for the afterupdate event for the form underlying the subform

public sub form_afterupdate(
msgbox "data updated
end su

Then enter data in the subform e click anywhere outside the subform
Did the message appear
If yes, click the "print" button to see if the report print out properly with the updated data

If it works i'll give you samo more advice

By
Rocc
 
peg said:
I have a form that has a subform (which then also has a couple
subforms in it)

On the 1st subform i have a button to print a report based on the
info in the subform.

My problem is if they just enetered or updated the data i can't get
it to save before it goes to print.

In the print command button code I placed: me.recordset.update but
that didn't do anything.

also tried this:

Set frm1 = Forms("ProgressNote")
Set ctl1 = frm1.Child6
ctl1.Form.Recordset.Update

that didn't do aything either.

Anyone have any ideas?? THANKS!!

Put this in your button's code, before opening the report:

If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
 
Back
Top