I'm trying to show these titles when month number is input. When number 1 to 6 is entered all the months is visible but when number >=7 is entered JUL to DEC is not visible. Where did the code go wrong. Help..
Also if there is more elegant way of coding this that would be great. Thanks.
The months are displayed
JUL AUG SEPT OCT NOV DEC JAN FEB MAR APR MAY JUN
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
If (Me.MoInput >= 1 And Me.MoInput <= 6) Then
Me.JUL_TITLE.Visible = True
Me.AUG_TITLE.Visible = True
Me.SEP_TITLE.Visible = True
Me.OCT_TITLE.Visible = True
Me.NOV_TITLE.Visible = True
Me.DEC_TITLE.Visible = True
Me.JAN_TITLE.Visible = True
If (Me.MoInput >= 2 And Me.MoInput <= 6) Then
Me.FEB_TITLE.Visible = True
If (Me.MoInput >= 3 And Me.MoInput <= 6) Then
Me.MAR_TITLE.Visible = True
If (Me.MoInput >= 4 And Me.MoInput <= 6) Then
Me.APR_TITLE.Visible = True
If (Me.MoInput >= 5 And Me.MoInput <= 6) Then
Me.MAY_TITLE.Visible = True
If (Me.MoInput = 6) Then
Me.JUN_TITLE.Visible = True
If (Me.MoInput >= 7) Then
Me.JUL_TITLE.Visible = True
End If
End If
End If
End If
End If
End If
End If
End Sub
Also if there is more elegant way of coding this that would be great. Thanks.
The months are displayed
JUL AUG SEPT OCT NOV DEC JAN FEB MAR APR MAY JUN
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
If (Me.MoInput >= 1 And Me.MoInput <= 6) Then
Me.JUL_TITLE.Visible = True
Me.AUG_TITLE.Visible = True
Me.SEP_TITLE.Visible = True
Me.OCT_TITLE.Visible = True
Me.NOV_TITLE.Visible = True
Me.DEC_TITLE.Visible = True
Me.JAN_TITLE.Visible = True
If (Me.MoInput >= 2 And Me.MoInput <= 6) Then
Me.FEB_TITLE.Visible = True
If (Me.MoInput >= 3 And Me.MoInput <= 6) Then
Me.MAR_TITLE.Visible = True
If (Me.MoInput >= 4 And Me.MoInput <= 6) Then
Me.APR_TITLE.Visible = True
If (Me.MoInput >= 5 And Me.MoInput <= 6) Then
Me.MAY_TITLE.Visible = True
If (Me.MoInput = 6) Then
Me.JUN_TITLE.Visible = True
If (Me.MoInput >= 7) Then
Me.JUL_TITLE.Visible = True
End If
End If
End If
End If
End If
End If
End If
End Sub