Tecnologia, programação e muito Visual FoxPro.

terça-feira, 29 de dezembro de 2009

[Access VBA Central] Access 2007 migration issue.

 

I have a 97-2003 version .mdb that works fine in the older Access, however when run or even converted into Access 2007 it just doesn't fully work and I have no idea why, rebuilding would be effectively the same code and process, so what am I missing? The users have been upgraded to Access 2007, thus the need.

Please scan this code quickly and give your best attempt at pointing me in the right direction: It basically is a button to filter on the form, but only works 1 time, then won't release the stored variable that is filtering for the record. Where is the degradation in the conversion?

Private Sub FindActivityRcd_Click()
On Error GoTo Err_FindActivityRcd_Click
stDocName = "Find Activity"
DoCmd.RunMacro stDocName
Call txtYear_AfterUpdate

Exit_FindActivityRcd_Click:
Exit Sub

Err_FindActivityRcd_Click:
MsgBox Err.Description
Resume Exit_FindActivityRcd_Click

End Sub
Private Sub AddNewRcd_Click()
On Error GoTo Err_AddNewRcd_Click

DoCmd.GoToRecord , , acNewRec

Exit_AddNewRcd_Click:
Exit Sub

Err_AddNewRcd_Click:
MsgBox Err.Description
Resume Exit_AddNewRcd_Click

End Sub

Private Sub txtYear_AfterUpdate()

Dim myMonth As Integer

myMonth = Month(Now())
'myMonth = 12

If Me.txtYear.Column(1) = "CY" Or Me.txtYear.Column(1) = "PY" Then

Select Case myMonth

Case 1

Me.January_Budget.Visible = True
Me.February_Budget.Visible = True
Me.March_Budget.Visible = True
Me.April_Budget.Visible = True
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = True
Me.Prev_Month_February_Est.Visible = True
Me.Prev_Month_March_Est.Visible = True
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Budget]+[February Budget]+[March Budget]"
Me.Q1PrevEst.ControlSource = "=[Prev Month January Est]+[Prev Month February Est]+[Prev Month March Est]"

Me.Q2CurrEst.ControlSource = "=[April Budget]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = True
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = True
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 2

Me.January_Budget.Visible = False
Me.February_Budget.Visible = True
Me.March_Budget.Visible = True
Me.April_Budget.Visible = True
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = True
Me.Prev_Month_February_Est.Visible = True
Me.Prev_Month_March_Est.Visible = True
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Budget]+[March Budget]"
Me.Q1PrevEst.ControlSource = "=[Prev Month January Est]+[Prev Month February Est]+[Prev Month March Est]"

Me.Q2CurrEst.ControlSource = "=[April Budget]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = True
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = True
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 3

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = True
Me.April_Budget.Visible = True
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = True
Me.Prev_Month_March_Est.Visible = True
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Budget]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[Prev Month February Est]+[Prev Month March Est]"

Me.Q2CurrEst.ControlSource = "=[April Budget]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = True
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = True
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 4

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = True
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = True
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[Prev Month March Est]"

Me.Q2CurrEst.ControlSource = "=[April Budget]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = True
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 5

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 6

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 7

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 8

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = False
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = False
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"

Me.Q3CurrEst.ControlSource = "=[July Actual]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = False
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 9

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = False
Me.August_Budget.Visible = False
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = False
Me.Prev_Month_July_Est.Visible = False
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"

Me.Q3CurrEst.ControlSource = "=[July Actual]+[August Actual]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[July Actual]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = False
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 10

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = False
Me.August_Budget.Visible = False
Me.September_Budget.Visible = False
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = False
Me.Prev_Month_July_Est.Visible = False
Me.Prev_Month_August_Est.Visible = False
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"

Me.Q3CurrEst.ControlSource = "=[July Actual]+[August Actual]+[September Actual]"
Me.Q3PrevEst.ControlSource = "=[July Actual]+[August Actual]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = False
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = False
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True

Case 11

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = False
Me.August_Budget.Visible = False
Me.September_Budget.Visible = False
Me.October_Budget.Visible = False
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = False
Me.Prev_Month_July_Est.Visible = False
Me.Prev_Month_August_Est.Visible = False
Me.Prev_Month_September_Est.Visible = False
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"

Me.Q3CurrEst.ControlSource = "=[July Actual]+[August Actual]+[September Actual]"
Me.Q3PrevEst.ControlSource = "=[July Actual]+[August Actual]+[September Actual]"

Me.Q4CurrEst.ControlSource = "=[October Actual]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = False
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = False
Me.Q3PrevEst.Visible = False
Me.Q4PrevEst.Visible = True

Case 12

Me.January_Budget.Visible = False
Me.February_Budget.Visible = False
Me.March_Budget.Visible = False
Me.April_Budget.Visible = False
Me.May_Budget.Visible = False
Me.June_Budget.Visible = False
Me.July_Budget.Visible = False
Me.August_Budget.Visible = False
Me.September_Budget.Visible = False
Me.October_Budget.Visible = False
Me.November_Budget.Visible = False
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = False
Me.Prev_Month_February_Est.Visible = False
Me.Prev_Month_March_Est.Visible = False
Me.Prev_Month_April_Est.Visible = False
Me.Prev_Month_May_Est.Visible = False
Me.Prev_Month_June_Est.Visible = False
Me.Prev_Month_July_Est.Visible = False
Me.Prev_Month_August_Est.Visible = False
Me.Prev_Month_September_Est.Visible = False
Me.Prev_Month_October_Est.Visible = False
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"
Me.Q1PrevEst.ControlSource = "=[January Actual]+[February Actual]+[March Actual]"

Me.Q2CurrEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"
Me.Q2PrevEst.ControlSource = "=[April Actual]+[May Actual]+[June Actual]"

Me.Q3CurrEst.ControlSource = "=[July Actual]+[August Actual]+[September Actual]"
Me.Q3PrevEst.ControlSource = "=[July Actual]+[August Actual]+[September Actual]"

Me.Q4CurrEst.ControlSource = "=[October Actual]+[November Actual]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[October Actual]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = False
Me.Q2CurrEst.Visible = False
Me.Q3CurrEst.Visible = False
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = False
Me.Q2PrevEst.Visible = False
Me.Q3PrevEst.Visible = False
Me.Q4PrevEst.Visible = True

End Select
End If

If Me.txtYear.Column(1) = "NY" Then


Me.January_Budget.Visible = True
Me.February_Budget.Visible = True
Me.March_Budget.Visible = True
Me.April_Budget.Visible = True
Me.May_Budget.Visible = True
Me.June_Budget.Visible = True
Me.July_Budget.Visible = True
Me.August_Budget.Visible = True
Me.September_Budget.Visible = True
Me.October_Budget.Visible = True
Me.November_Budget.Visible = True
Me.December_Budget.Visible = True

Me.Prev_Month_January_Est.Visible = True
Me.Prev_Month_February_Est.Visible = True
Me.Prev_Month_March_Est.Visible = True
Me.Prev_Month_April_Est.Visible = True
Me.Prev_Month_May_Est.Visible = True
Me.Prev_Month_June_Est.Visible = True
Me.Prev_Month_July_Est.Visible = True
Me.Prev_Month_August_Est.Visible = True
Me.Prev_Month_September_Est.Visible = True
Me.Prev_Month_October_Est.Visible = True
Me.Prev_Month_November_Est.Visible = True
Me.Prev_Month_December_Est.Visible = True

Me.Q1CurrEst.ControlSource = "=[January Budget]+[February Budget]+[March Budget]"
Me.Q1PrevEst.ControlSource = "=[Prev Month January Est]+[Prev Month February Est]+[Prev Month March Est]"

Me.Q2CurrEst.ControlSource = "=[April Budget]+[May Budget]+[June Budget]"
Me.Q2PrevEst.ControlSource = "=[Prev Month April Est]+[Prev Month May Est]+[Prev Month June Est]"

Me.Q3CurrEst.ControlSource = "=[July Budget]+[August Budget]+[September Budget]"
Me.Q3PrevEst.ControlSource = "=[Prev Month July Est]+[Prev Month August Est]+[Prev Month September Est]"

Me.Q4CurrEst.ControlSource = "=[October Budget]+[November Budget]+[December Budget]"
Me.Q4PrevEst.ControlSource = "=[Prev Month October Est]+[Prev Month November Est]+[Prev Month December Est]"

Me.Q1CurrEst.Visible = True
Me.Q2CurrEst.Visible = True
Me.Q3CurrEst.Visible = True
Me.Q4CurrEst.Visible = True

Me.Q1PrevEst.Visible = True
Me.Q2PrevEst.Visible = True
Me.Q3PrevEst.Visible = True
Me.Q4PrevEst.Visible = True
End If
End Sub

__._,_.___
.

__,_._,___

Nenhum comentário:

Arquivo do blog