Here's me code:
I've been building this code to deal with records in the report that cause the 2-page report for each record to be poorly formatted (either on 3 pages or a poorly placed page break). But, it seems like every time I add something new something I did previously gets screwed up! I think I understand why, but dealing with it is another issue, LOL. It seems like I might need to change the order of my If .. Then statements. I've tried this, and it just confuses me more. I tried changing the Else statements to ElseIf IsNull(Unavailable), but the problem with that is AFTER the other records are affected, the setting needs to be changed back. I guess that's my problem. I need to be able to CHANGE SETTINGS BACK after each record affected. This Else method is just not working.
Code:
If BreakFlag1 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
If IsNull(Unavailable) Then
Me.PageBreak2.Visible = False
Me.Label154.Visible = True
Me.Label136.Visible = True
Me.Label139.Visible = True
Me.Label160.Visible = False
Me.Text127.Visible = True
Me.Graph110.Visible = True
Me.GraphHeader.Visible = True
Me.Significant.Visible = True
Me.Aptitudes.Visible = True
Me.Significant.Visible = True
Me.AptitudeList.Visible = True
Me.Unavailable.Visible = False
Me.Unavailable1.Visible = False
Me.Unavailable2.Visible = False
Me.Unavailable3.Visible = False
Me.Unavailable4.Visible = False
Else
Me.PageBreak2.Visible = True
Me.Label154.Visible = False
Me.Label136.Visible = False
Me.Label139.Visible = False
Me.Label160.Visible = True
Me.Text127.Visible = False
Me.Graph110.Visible = False
Me.GraphHeader.Visible = False
Me.Significant.Visible = False
Me.Aptitudes.Visible = False
Me.Significant.Visible = False
Me.AptitudeList.Visible = False
Me.Unavailable.Visible = True
Me.Unavailable1.Visible = True
Me.Unavailable2.Visible = True
Me.Unavailable3.Visible = True
Me.Unavailable4.Visible = True
End If
If BreakFlag2 Then
Me.PageBreak3.Visible = True
Else
Me.PageBreak3.Visible = False
End If
If SOC = "21-1011" Then
Me.License1.Top = 7200
Me.Label9.Top = 7800
Me.Unavailable1.Top = 8300
Me.License2.Top = 7450
End If
If SOC = "49-3023" Then
Me.Label8.Top = 8000
Me.Label9.Top = 8000
Me.subreport1.Top = 8400
Me.subreport2.Top = 8400
Me.subreport1.Height = 2000
Me.Label87.Top = 10500
Me.Text86.Top = 10920
Me.Label10.Top = 9800
Me.Significant.Top = 9800
Me.GraphHeader.Top = 9800
Me.Aptitudes.Top = 10220
Me.Graph110.Top = 9980
Me.AptitudeList.Top = 10234
Me.Aptitudes.Top = 10220
Me.Label19.Top = 12500
Me.Label136.Top = 12620
Me.Text18.Top = 12980
Else
Me.subreport1.Height = 944
Me.Label8.Top = 9900
Me.subreport1.Top = 10320
Me.Label87.Top = 11340
Me.Text86.Top = 11760
Me.Label10.Top = 9900
Me.Significant.Top = 9900
Me.GraphHeader.Top = 9900
Me.Aptitudes.Top = 10320
Me.Graph110.Top = 10080
Me.AptitudeList.Top = 10334
Me.Aptitudes.Top = 10320
Me.Label19.Top = 12600
Me.Label136.Top = 12720
Me.Text18.Top = 13080
End If
If SOC = "33-3051" Or SOC = "33-9032" Then
Me.Label8.Top = Me.Label9.Top
Me.subreport1.Top = Me.subreport2.Top
Me.Label87.Top = Me.Label10.Top
Me.Text86.Top = Me.Aptitudes.Top
Else
Me.Label8.Top = 9840
Me.subreport1.Top = 10260
Me.Label87.Top = 11280
Me.Text86.Top = 11700
End If
If SOC = "47-2031" Then
Me.Label8.Top = Me.Label9.Top
Me.subreport1.Top = Me.subreport2.Top
Me.Label87.Top = Me.Label10.Top
Me.Text86.Top = Me.Aptitudes.Top
Else
Me.Label8.Top = 9840
Me.subreport1.Top = 10260
Me.Label87.Top = 11280
Me.Text86.Top = 11700
End If
I've been building this code to deal with records in the report that cause the 2-page report for each record to be poorly formatted (either on 3 pages or a poorly placed page break). But, it seems like every time I add something new something I did previously gets screwed up! I think I understand why, but dealing with it is another issue, LOL. It seems like I might need to change the order of my If .. Then statements. I've tried this, and it just confuses me more. I tried changing the Else statements to ElseIf IsNull(Unavailable), but the problem with that is AFTER the other records are affected, the setting needs to be changed back. I guess that's my problem. I need to be able to CHANGE SETTINGS BACK after each record affected. This Else method is just not working.