G
Guest
Hi,
I have a report that has a sub-report (sub-report1) in it. Based on the
value of a field say studID, i'd like to be able to hide/unhide the
sub-reports.
What i'd like to see in the report is
StudID 1
subreport1
StudID 3
StudID 4
StudID 5
StudID 6
and so on
Here is the code
Code:
Private Sub Report_Open(Cancel As Integer)
If Me.StudID > 2 and Me.StudID < 8 Then
Me.subreport1.Visible = False
Else
Me.subreport1.Visible = True
End If
End SubThe problem with the above code is that it says that StudID has no
value.
Then
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.StudID > 2 and Me.StudID < 8 Then
Me.subreport1.Visible = False
Else
Me.subreport1.Visible = True
End If
End SubThe problem with this is that the subreport1 appears after StudID is
1 (one) but i got nothing after StudID = 3.
I'd greatly appreciate your help.
Thank you in advance
I have a report that has a sub-report (sub-report1) in it. Based on the
value of a field say studID, i'd like to be able to hide/unhide the
sub-reports.
What i'd like to see in the report is
StudID 1
subreport1
StudID 3
StudID 4
StudID 5
StudID 6
and so on
Here is the code
Code:
Private Sub Report_Open(Cancel As Integer)
If Me.StudID > 2 and Me.StudID < 8 Then
Me.subreport1.Visible = False
Else
Me.subreport1.Visible = True
End If
End SubThe problem with the above code is that it says that StudID has no
value.
Then
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.StudID > 2 and Me.StudID < 8 Then
Me.subreport1.Visible = False
Else
Me.subreport1.Visible = True
End If
End SubThe problem with this is that the subreport1 appears after StudID is
1 (one) but i got nothing after StudID = 3.
I'd greatly appreciate your help.
Thank you in advance