Unanswered: MS Access Report - Hide image based on checkbox
I have a subreport that contains a bound object frame that I want to hide if a checkbox has not been checked on a form. What code do I use and where to show/hide the image frame based on the value of the checkbox.
Function IsLoaded(ByVal strFormName As String) As Boolean
[color=green' Returns True if the specified form is open in Form view or Datasheet view.[/color]
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
The handy function above simply allows you to see (confirm) if a Access Form is open.
Now, in the On Format event for the Detail section of your Report, enter code similar to what is shown below:
If IsLoaded("myMainFormName") Then
Forms![mySubReportName]![mysubReportImageBoxName].Visible = _