Question : access 2003: subreport not hiding controls

Hi,

I have a report that has subreports in it to show specific data. One specific subreport is supposed to hide a few fields if they are not populated. This works fine if I open the subreport on its own. However, when I run the report, the subreport wont hide the fields that are null. So, it works on its own, but not in the report. Here is my code..
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Option Compare Database

Private Sub Report_Activate()
    If IsNull(Me.txtIOPNCTOD And Me.txtIOPNCTOS And Me.txtIOPNCTTime) = True Then
        Me.lblIOPNCTTitle.Visible = False
        Me.txtIOPNCTOD.Visible = False
        Me.txtIOPNCTOS.Visible = False
        Me.txtIOPNCTTime.Visible = False
        Me.lblIOPNCTOD.Visible = False
        Me.lblIOPNCTOS.Visible = False
        Me.lblIOPNCTTime.Visible = False
    ElseIf IsNull(Me.txtIOPPerkinsOD And Me.txtIOPPerkinsOS And Me.txtIOPPerkinsTime) = True Then
        Me.lblIOPPerkinsTitle.Visible = False
        Me.txtIOPPerkinsOD.Visible = False
        Me.txtIOPPerkinsOS.Visible = False
        Me.txtIOPPerkinsTime.Visible = False
        Me.lblIOPPerkinsOD.Visible = False
        Me.lblIOPPerkinsOS.Visible = False
        Me.lblIOPPerkinsTime.Visible = False
    Else
        Me.lblIOPNCTTitle.Visible = False
        Me.txtIOPNCTOD.Visible = False
        Me.txtIOPNCTOS.Visible = False
        Me.txtIOPNCTTime.Visible = False
        Me.lblIOPNCTOD.Visible = False
        Me.lblIOPNCTOS.Visible = False
        Me.lblIOPNCTTime.Visible = False

        Me.lblIOPPerkinsTitle.Visible = False
        Me.txtIOPPerkinsOD.Visible = False
        Me.txtIOPPerkinsOS.Visible = False
        Me.txtIOPPerkinsTime.Visible = False
        Me.lblIOPPerkinsOD.Visible = False
        Me.lblIOPPerkinsOS.Visible = False
        Me.lblIOPPerkinsTime.Visible = False
    End If
End Sub

Answer : access 2003: subreport not hiding controls

You can use a seperate part of maintenace plan functionality to do this - Maintenance Cleanup Task:
http://msdn.microsoft.com/en-us/library/ms177182.aspx

Suggest you include it as a conditional part of the sub plan so old backups only get cleaned up once a new backup has been created.
Random Solutions  
 
programming4us programming4us