CraigDolphin
GrumpyOldMan in Training
- Local time
- Today, 12:00
- Joined
- Dec 21, 2005
- Messages
- 1,582
I am working on a fisheries regulations database. I have a report summarizing basic regulation information (date filed etc) which contains a subreport that details which gear type(s) are being covered in the regulation. Within this subreport, I have a (sub)form (generic_conditions) that lists many kinds of gear restrictions etc.
I have used the on_current event of the form to make controls with no data invisible. This is necessary since different conditions apply to different gear types (eg, net mesh size is irrelevant if you're using a fishing pole). In the interests of saving space on the report, I have overlapping controls such that net fishing conditions occupy the same space on the form as crab pot conditions. When I open the form directly, all works as it should. Empty controls and their labels are not displayed.
However, when I open the report, the form shows up with the right information for the specific gear type and regulation, but all controls are visible and therefore overallping and impossible to read. If I switch the default Visible property of each control on the form to 'no' then none of the conditions appear even if data is present.
Here's an example of the code setting the visible property for one of the controls inside the on_current event of the form.
It seems like the report is ignoring the on_current event of the subform. I've tried using the code in the on_open event of the main report, or of the form's parent subreport but have not had any success. I keep getting errors with my code when I try that (yes, I changed the link to the controls to match the path from the report/subreport when I made that change)
I'm stumped. Anyone offer me some insight into why this is happening?
Appreciate any replies.
I have used the on_current event of the form to make controls with no data invisible. This is necessary since different conditions apply to different gear types (eg, net mesh size is irrelevant if you're using a fishing pole). In the interests of saving space on the report, I have overlapping controls such that net fishing conditions occupy the same space on the form as crab pot conditions. When I open the form directly, all works as it should. Empty controls and their labels are not displayed.
However, when I open the report, the form shows up with the right information for the specific gear type and regulation, but all controls are visible and therefore overallping and impossible to read. If I switch the default Visible property of each control on the form to 'no' then none of the conditions appear even if data is present.
Here's an example of the code setting the visible property for one of the controls inside the on_current event of the form.
Code:
If Me.FishHooksizes & "" = "" Then
Me.FishHooksizes.Visible = False
Else: Me.FishHooksizes.Visible = True
End If
It seems like the report is ignoring the on_current event of the subform. I've tried using the code in the on_open event of the main report, or of the form's parent subreport but have not had any success. I keep getting errors with my code when I try that (yes, I changed the link to the controls to match the path from the report/subreport when I made that change)
I'm stumped. Anyone offer me some insight into why this is happening?
Appreciate any replies.
