form updates

This commit is contained in:
Trowbridge 2019-03-05 11:39:35 -05:00
parent 878e691a55
commit 678c0cafc9
2 changed files with 17 additions and 10 deletions

View File

@ -14,6 +14,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public mod_adjust As Boolean
Public month() As Variant
Option Explicit
@ -102,11 +103,11 @@ End Sub
Private Sub UserForm_Activate()
Dim s_tot As Object
Dim sp As Object
Dim i As Long
Dim ok As Boolean
Set s_tot = handler.scenario_totals(handler.scenario, ok)
Set sp = handler.scenario_package(handler.scenario, ok)
If Not ok Then
fpvt.Hide
@ -118,18 +119,18 @@ Private Sub UserForm_Activate()
'---show existing adjustment if there is one----
fpvt.mod_adjust = False
For i = 1 To s_tot("x").Count
Select Case s_tot("x")(i)("order_season")
For i = 1 To sp("package")("totals").Count
Select Case sp("package")("totals")(i)("order_season")
Case 2020
Select Case s_tot("x")(i)("iter")
Select Case sp("package")("totals")(i)("iter")
Case "copy"
fpvt.tbBaseVol.Text = Format(s_tot("x")(i)("units"), "#,###")
fpvt.tbBaseVal.Text = Format(s_tot("x")(i)("value_usd"), "#,###")
If s_tot("x")(i)("units") <> 0 Then fpvt.tbBasePrice.Text = Format(s_tot("x")(i)("value_usd") / s_tot("x")(i)("units"), "#.000")
fpvt.tbBaseVol.Text = Format(sp("package")("totals")(i)("units"), "#,###")
fpvt.tbBaseVal.Text = Format(sp("package")("totals")(i)("value_usd"), "#,###")
If sp("package")("totals")(i)("units") <> 0 Then fpvt.tbBasePrice.Text = Format(sp("package")("totals")(i)("value_usd") / sp("package")("totals")(i)("units"), "#.000")
Case "adjustment"
fpvt.tbPadjVol.Text = Format(s_tot("x")(i)("units"), "#,###")
fpvt.tbPadjVal.Text = Format(s_tot("x")(i)("value_usd"), "#,###")
fpvt.tbPadjVol.Text = Format(sp("package")("totals")(i)("units"), "#,###")
fpvt.tbPadjVal.Text = Format(sp("package")("totals")(i)("value_usd"), "#,###")
End Select
End Select
@ -139,6 +140,12 @@ Private Sub UserForm_Activate()
fpvt.tbFcVal.value = Format(CDbl(fpvt.tbBaseVal.value) + CDbl(fpvt.tbPadjVal.value), "#,###")
fpvt.tbFcPrice.value = Format(CDbl(fpvt.tbFcVal.value) / CDbl(fpvt.tbFcVol.value), "#.000")
'---------------------------------------populate monthly-------------------------------------------------------
'--parse json into variant array for loading--
Application.StatusBar = False
End Sub

BIN
fpvt.frx

Binary file not shown.