G
Guest
I have the following code in a report that I'm trying to get to print from a
form.
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmPrintYardSaleApplication", , , , , acDialog
If Not IsLoaded("frmPrintYardSaleApplication") Then
Cancel = True
End If
End Sub
I copied this from an Event Management Access database that was on the
Microsoft Website. This program had a button on a form that would print an
invoice when selected. It did this by first calling a report object that then
called a form object that would print the report. At least I think that's the
way it did it. I'm relatively new to this and still working my way through. I
took this and tried to adapt it to my program, but when I try to preview the
report I get a VB error:
"Compile Error
Sub or Function not defined" - and the IsLoaded word is highlighted.
I have checked all the places I know to check to make sure that the name for
the form is correct and it is...at least where I know to check. If anyone
could point me in the right direction I would appreciate it. Thanks to
everyone who have helped me in the past and hopefully will in the future. One
day maybe I'll be able to 'pass it on' after I get fluent enough in Access
and VBA.
Thanks,
Randy M
form.
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmPrintYardSaleApplication", , , , , acDialog
If Not IsLoaded("frmPrintYardSaleApplication") Then
Cancel = True
End If
End Sub
I copied this from an Event Management Access database that was on the
Microsoft Website. This program had a button on a form that would print an
invoice when selected. It did this by first calling a report object that then
called a form object that would print the report. At least I think that's the
way it did it. I'm relatively new to this and still working my way through. I
took this and tried to adapt it to my program, but when I try to preview the
report I get a VB error:
"Compile Error
Sub or Function not defined" - and the IsLoaded word is highlighted.
I have checked all the places I know to check to make sure that the name for
the form is correct and it is...at least where I know to check. If anyone
could point me in the right direction I would appreciate it. Thanks to
everyone who have helped me in the past and hopefully will in the future. One
day maybe I'll be able to 'pass it on' after I get fluent enough in Access
and VBA.
Thanks,
Randy M