Sub report VBA not firing when loaded through main report

Juett

Registered User.
Local time
Today, 13:06
Joined
Jul 16, 2019
Messages
71
Hi Guys,

I have a little issue with some VBA code in a sub report.

The following code works in the sub report when opened directly:

Code:
Private Sub Report_Load()
If IsNull(cmb1.Value) Then
    Me.img1.Visible = False
Else
    Me.img1.Visible = True
End If
End Sub

It displays or hides an image based on the value of a combo box.

But...when I insert this report as a sub report in another (main form) and open it, the code does not fire.

What do you think I might be missing?

Thanks very much.
 
reports event don't fire when inserted as subreport.
set it on the main reports load event:

private sub report_load()
me.subreportname!img1.Visible = (IsNull(me.subreportname!cmb1)=False)
end sub
 
That worked perfectly, thanks very much!
 
you are welcome!
 

Users who are viewing this thread

Back
Top Bottom