Option Explicit Sub updateCommon1(cboxno) Dim Sci_Name Dim Ctrls, SC1 Set Sci_Name = Application.Map.Layers("STEMS") Set Ctrls = Sci_Name.Forms("EDITFORM").Pages("TP_INTR").controls select case cboxno case 1 ctrls("CB_COM").value = ctrls("CB_SCI").text End select End Sub Sub updateScience1(cboxno) Dim Com_Name Dim Ctrls, SC1 Set Com_Name = Application.Map.Layers("STEMS") Set Ctrls = Com_Name.Forms("EDITFORM").Pages("TP_INTR").controls select case cboxno case 1 ctrls("CB_SCI").value = ctrls("CB_COM").text End select End Sub Sub updateTotals1(cboxno) 'Dim StemsLyr Dim Ctrls, LBL, C1, C2, C3, C4, C5 'Set StemsLyr = Application.Map.Layers("STEMS") Set LBL = Layer.Forms("EDITFORM").Pages("TP_TOTA").controls Set Ctrls = Layer.Forms("EDITFORM").Pages("TP_COND").controls select case cboxno case 1 ctrls("SCR_FRM").value = ctrls("CB_COND").text case 2 ctrls("SCR_OCC").value = ctrls("CB_OCCU").text case 3 ctrls("SCR_VNV").value = ctrls("CB_VNV").text case 4 ctrls("SCR_FUN").value = ctrls("CB_FUNC").text case 5 ctrls("SCR_AGE").value = ctrls("CB_AGE").text End select if ctrls("SCR_FRM").value="" then C1 = 0 else C1 = cint(ctrls("SCR_FRM").value) end if if ctrls("SCR_OCC").value="" then C2 = 0 else C2 = cint(ctrls("SCR_OCC").value) end if if ctrls("SCR_VNV").value="" then C3 = 0 else C3 = cint(ctrls("SCR_VNV").value) end if if ctrls("SCR_FUN").value="" then C4 = 0 else C4 = cint(ctrls("SCR_FUN").value) end if if ctrls("SCR_AGE").value="" then C5 = 0 else C5 = cint(ctrls("SCR_AGE").value) end if ctrls("SUB_CON").value = cstr(C1 + C2 + C3 + C4 + C5) LBL("SCR_COND").value = ctrls("SUB_CON") End Sub Sub EnablePageControls(strPageName1, strPageName2, strPageName3, blnEnable) Dim objForm Dim c Dim p Set objForm = ThisEvent.Object.Parent.Parent For Each c in objForm.Pages If (C.name = strPageName1 Or C.name = strPageName2 Or C.name = strPageName3) then For Each p in c.controls p.Enabled = True Next End If Next Set objForm = Nothing Set c = Nothing End Sub Sub DisableAllPages(strPageToIgnore1,strPageToIgnore2,strPageToIgnore3,strPageToIgnore4,strPageToIgnore5) Dim objForm Dim p Dim c Set objForm = ThisEvent.Object 'Sets all controls to disabled unless on the page to ignore For Each p in objForm.Pages If Not (p.Name = strPageToIgnore1 Or p.Name = strPageToIgnore2 Or p.Name = strPageToIgnore3 Or p.Name = strPageToIgnore4 Or p.Name = strPageToIgnore5) Then For Each c in p.Controls c.Enabled = False Next End If Next Set objForm = Nothing End Sub Sub updateTotals2(cboxno) Dim Ctrls, LBL, A1, A2, A3, A4, A5 Set LBL = Layer.Forms("EDITFORM").Pages("TP_TOTA").controls Set Ctrls = Layer.Forms("EDITFORM").Pages("TP_AMEN").controls select case cboxno case 1 ctrls("SCR_STA").value = ctrls("CB_STAT").text case 2 ctrls("SCR_VIS").value = ctrls("CB_VISB").text case 3 ctrls("SCR_PRO").value = ctrls("CB_PROX").text case 4 ctrls("SCR_ROL").value = ctrls("CB_ROLE").text case 5 ctrls("SCR_CLI").value = ctrls("CB_CLIM").text End select if ctrls("SCR_STA").value="" then A1 = 0 else A1 = cint(ctrls("SCR_STA").value) end if if ctrls("SCR_VIS").value="" then A2 = 0 else A2 = cint(ctrls("SCR_VIS").value) end if if ctrls("SCR_PRO").value="" then A3 = 0 else A3 = cint(ctrls("SCR_PRO").value) end if if ctrls("SCR_ROL").value="" then A4 = 0 else A4 = cint(ctrls("SCR_ROL").value) end if if ctrls("SCR_CLI").value="" then A5 = 0 else A5 = cint(ctrls("SCR_CLI").value) end if ctrls("SUB_AME").value = cstr(A1 + A2 + A3 + A4 + A5) LBL("SCR_AMEN").value = ctrls("SUB_AME") End Sub Sub updateTotals3(cboxno) Dim Ctrls, LBL, NS1, NS2 Set LBL = Layer.Forms("EDITFORM").Pages("TP_TOTA").controls Set Ctrls = Layer.Forms("EDITFORM").Pages("TP_NOT1").controls select case cboxno case 1 ctrls("SCR_FEA").value = ctrls("CB_FEAT").text case 2 ctrls("SCR_FORM").value = ctrls("CB_FOR2").text End select if ctrls("SCR_FEA").value="" then NS1 = 0 else NS1 = cint(ctrls("SCR_FEA").value) end if if ctrls("SCR_FORM").value="" then NS2 = 0 else NS2 = cint(ctrls("SCR_FORM").value) end if ctrls("SUB_NOT1").value = cstr(NS1 + NS2) LBL("SCR_NOT1").value = ctrls("SUB_NOT1") End Sub Sub updateTotals4(cboxno) Dim Ctrls, LBL, NH1, NH2, NH3, NH4, NH5 Set LBL = Layer.Forms("EDITFORM").Pages("TP_TOTA").controls Set Ctrls = Layer.Forms("EDITFORM").Pages("TP_NOT2").controls select case cboxno case 1 ctrls("SCR_AG2").value = ctrls("CB_AGE2").text case 2 ctrls("SCR_ASS").value = ctrls("CB_ASSO").text case 3 ctrls("SCR_COM").value = ctrls("CB_COMM").text case 4 ctrls("SCR_REM").value = ctrls("CB_REMN").text case 5 ctrls("SCR_REL").value = ctrls("CB_RELI").text End select if ctrls("SCR_AG2").value="" then NH1 = 0 else NH1 = cint(ctrls("SCR_AG2").value) end if if ctrls("SCR_ASS").value="" then NH2 = 0 else NH2 = cint(ctrls("SCR_ASS").value) end if if ctrls("SCR_COM").value="" then NH3 = 0 else NH3 = cint(ctrls("SCR_COM").value) end if if ctrls("SCR_REM").value="" then NH4 = 0 else NH4 = cint(ctrls("SCR_REM").value) end if if ctrls("SCR_REL").value="" then NH5 = 0 else NH5 = cint(ctrls("SCR_REL").value) end if ctrls("SUB_NOT2").value = cstr(NH1 + NH2 + NH3 + NH4 + NH5) LBL("SCR_NOT2").value = ctrls("SUB_NOT2") End Sub Sub updateTotals5(cboxno) Dim Ctrls, LBL, NSC1, NSC2, NSC3, NSC4 Dim N1, N2, N3 Dim C, A, N Set LBL = Layer.Forms("EDITFORM").Pages("TP_TOTA").controls Set Ctrls = Layer.Forms("EDITFORM").Pages("TP_NOT3").controls select case cboxno case 1 ctrls("SCR_SOU").value = ctrls("CB_SOUR").text case 2 ctrls("SCR_RAR").value = ctrls("CB_RARI").text case 3 ctrls("SCR_END").value = ctrls("CB_ENDA").text case 4 ctrls("SCR_COL").value = ctrls("CB_COLL").text End select if ctrls("SCR_SOU").value="" then NSC1 = 0 else NSC1 = cint(ctrls("SCR_SOU").value) end if if ctrls("SCR_RAR").value="" then NSC2 = 0 else NSC2 = cint(ctrls("SCR_RAR").value) end if if ctrls("SCR_END").value="" then NSC3 = 0 else NSC3 = cint(ctrls("SCR_END").value) end if if ctrls("SCR_COL").value="" then NSC4 = 0 else NSC4 = cint(ctrls("SCR_COL").value) end if ctrls("SUB_NOT3").value = cstr(NSC1 + NSC2 + NSC3 + NSC4) LBL("SCR_NOT3").value = ctrls("SUB_NOT3") if LBL("SCR_NOT1").value="" then N1 = 0 else N1 = cint(LBL("SCR_NOT1").value) end if if LBL("SCR_NOT2").value="" then N2 = 0 else N2 = cint(LBL("SCR_NOT2").value) end if if LBL("SCR_NOT3").value="" then N3 = 0 else N3 = cint(LBL("SCR_NOT3").value) end if LBL("SCR_NOTA").value = cint(N1 + N2 + N3) if LBL("SCR_COND").value="" then C = 0 else C = cint(LBL("SCR_COND").value) end if if LBL("SCR_AMEN").value="" then A = 0 else A = cint(LBL("SCR_AMEN").value) end if if LBL("SCR_NOTA").value="" then N = 0 else N = cint(LBL("SCR_NOTA").value) end if LBL("SCR_TOTA").value = cint(C + A + N) End Sub