G
G
Hello.Access 2k/3k. I am using the OnPrint event of a subreport detail
to run some if statements. Only one subreport exists.
The if statements look at the values in text boxes on the subreport
that contain the results of some arithmetic. Depending on the results,
some textbox values are set and visible property of some textboxes on
the Parent report are modified.
The problem is that the results are inconsistent. The report is a
multipage ,2"*4" pages, with different values on each page.
It appears that the textbox values and visible properties on the main
report are sometimes one page behind. For example, subreport values on
pg 1 require main report textbox1 to be visible, but textbox1 on page1
will not be shown. Page2 will show textbox1.
Everyseen anything like this.Is Onprint of the subreport the right
event?
Here is the OnPrint event of the subreport detail:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Reports("Rpt_KanBanRIPbyAssyID")("retire").Visible = False
If Me("KBsize") < 0.99 Then
Me("KB") = Me("KBsize")
Reports("Rpt_KanBanRIPbyAssyID")("retire").Visible = True
Reports("Rpt_KanBanRIPbyAssyID")("retire") = "RETIRE --- NO DEMAND"
ElseIf Len(Me("KBsIZE")) < 1 Then
Me("kb") = 0
ElseIf Me("KBsize") < 1 Then
Me("KB") = Me("KBsize")
ElseIf Me("KBsize") < 2 Then
Me("KB") = 1
ElseIf Me("KBsize") < 5 And Me("KBsize") > 2 Then
Me("KB") = 5
ElseIf Me("KBSize") > 5 Then
Me("KB") = Round(Me("KBSize"), 0)
End If
End Sub
to run some if statements. Only one subreport exists.
The if statements look at the values in text boxes on the subreport
that contain the results of some arithmetic. Depending on the results,
some textbox values are set and visible property of some textboxes on
the Parent report are modified.
The problem is that the results are inconsistent. The report is a
multipage ,2"*4" pages, with different values on each page.
It appears that the textbox values and visible properties on the main
report are sometimes one page behind. For example, subreport values on
pg 1 require main report textbox1 to be visible, but textbox1 on page1
will not be shown. Page2 will show textbox1.
Everyseen anything like this.Is Onprint of the subreport the right
event?
Here is the OnPrint event of the subreport detail:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Reports("Rpt_KanBanRIPbyAssyID")("retire").Visible = False
If Me("KBsize") < 0.99 Then
Me("KB") = Me("KBsize")
Reports("Rpt_KanBanRIPbyAssyID")("retire").Visible = True
Reports("Rpt_KanBanRIPbyAssyID")("retire") = "RETIRE --- NO DEMAND"
ElseIf Len(Me("KBsIZE")) < 1 Then
Me("kb") = 0
ElseIf Me("KBsize") < 1 Then
Me("KB") = Me("KBsize")
ElseIf Me("KBsize") < 2 Then
Me("KB") = 1
ElseIf Me("KBsize") < 5 And Me("KBsize") > 2 Then
Me("KB") = 5
ElseIf Me("KBSize") > 5 Then
Me("KB") = Round(Me("KBSize"), 0)
End If
End Sub