Form & Report Problem

  • Thread starter Thread starter RBDU
  • Start date Start date
R

RBDU

Hello All! thanking anyone for a reply. A97.

I have a dataentry form and on its closing (after entering data) I want the
report (that directly relates to the dataentry record) I have made up to
print automatically.

This is to be done on the closing of that form, without prompting.

What is the best way to do this?

Regards Peter
 
Well I got it to work. More luck than skill. This is what I put in.

Note: So if the user opens the dataentry form and closes it without putting
anything in, they get a message & close the form. If they enter data the
report prints out. I have code in the on no data event, but this does not
fire.

In the report - On page event - code is put in to open up a form to warn the
user that the report is being printed out.
...................................................
Private Sub Form_Close ()

If IsNull (Me.ref_) Then
Msgbox "Thanks for coming."
Cancel = True
Docmd.cancelEvent

Else

If me.ref_ > 0 Then
Docmd.OpenReport "Invoice", acViewNormal, "qfilter"

End if
End if

End Sub
..........................................................
Hope this helps someone
Regards Peter.
 
Back
Top