L
Lori
I have a subform that I need to show certain data based on the current month.
The fields include Estimated and Actual $$ for each month. At present I have
all of the fields as Visible = No and the intent is to have All of the
Estimated Fields show up in Jan and Feb, but in Feb I need to see not only
the Est. field for Jan but the Actual Field as well. Right now I have the
code written as follows. I think my real problem is I don't know which
"event" to put it under. HELP
If Me.CurrentMo = 1 Then
Me.JanEst.Visible = True
Me.FebEst.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 2 Then
Me.JanEst.Visible = True
Me.JanAct.Visible = True
Me.FebEst.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 3 Then
Me.JanAct.Visible = True
Me.FebEst.Visible = True
Me.FebAct.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 4 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarEst.Visible = True
Me.MarAct.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 5 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprEst.Visible = True
Me.AprAct.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 6 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayEst.Visible = True
Me.MayAct.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 7 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunEst.Visible = True
Me.JunAct.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 8 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulEst.Visible = True
Me.JulAct.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 9 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AulEst.Visible = True
Me.AugAct.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 10 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepEst.Visible = True
Me.SepAct.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 11 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepAct.Visible = True
Me.OctEst.Visible = True
Me.OctAct.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 12 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepAct.Visible = True
Me.OctAct.Visible = True
Me.NovEst.Visible = True
Me.NovAct.Visible = True
Me.DecEst.Visible = True
End If
End Sub
The fields include Estimated and Actual $$ for each month. At present I have
all of the fields as Visible = No and the intent is to have All of the
Estimated Fields show up in Jan and Feb, but in Feb I need to see not only
the Est. field for Jan but the Actual Field as well. Right now I have the
code written as follows. I think my real problem is I don't know which
"event" to put it under. HELP
If Me.CurrentMo = 1 Then
Me.JanEst.Visible = True
Me.FebEst.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 2 Then
Me.JanEst.Visible = True
Me.JanAct.Visible = True
Me.FebEst.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 3 Then
Me.JanAct.Visible = True
Me.FebEst.Visible = True
Me.FebAct.Visible = True
Me.MarEst.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 4 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarEst.Visible = True
Me.MarAct.Visible = True
Me.AprEst.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 5 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprEst.Visible = True
Me.AprAct.Visible = True
Me.MayEst.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 6 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayEst.Visible = True
Me.MayAct.Visible = True
Me.JunEst.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 7 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunEst.Visible = True
Me.JunAct.Visible = True
Me.JulEst.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 8 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulEst.Visible = True
Me.JulAct.Visible = True
Me.AulEst.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 9 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AulEst.Visible = True
Me.AugAct.Visible = True
Me.SepEst.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 10 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepEst.Visible = True
Me.SepAct.Visible = True
Me.OctEst.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 11 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepAct.Visible = True
Me.OctEst.Visible = True
Me.OctAct.Visible = True
Me.NovEst.Visible = True
Me.DecEst.Visible = True
ElseIf Me.CurrentMo = 12 Then
Me.JanAct.Visible = True
Me.FebAct.Visible = True
Me.MarAct.Visible = True
Me.AprAct.Visible = True
Me.MayAct.Visible = True
Me.JunAct.Visible = True
Me.JulAct.Visible = True
Me.AugAct.Visible = True
Me.SepAct.Visible = True
Me.OctAct.Visible = True
Me.NovEst.Visible = True
Me.NovAct.Visible = True
Me.DecEst.Visible = True
End If
End Sub