killitmore > 13-12-17, 11:12 AM
Sub pre_computation_id_2() 'this sub will perform fair values calculation (See TECH_PRE_COMPUTATION table)
Dim pbar As Form_FRM_PROGRESS_BAR
If MsgBox("Please make sure that you finish all the preparation for fair values calculation before processing", vbOKCancel) = vbCancel Then
MsgBox Prompt:="Please do the following tasks: update market price, define spread and update curve infos."
DoCmd.OpenForm "FRM_SPREAD_DEFINE"
DoCmd.OpenTable "MKT_BOND_PRICES"
Exit Sub
End If
'Run the fair value calculation then dump result into MKT_FAIR_VALUE table
MsgBox Prompt:="Please be patient. Fair values calculation might take a while!"
Set pbar = New Form_FRM_PROGRESS_BAR ' create new instance of Progress Bar
pbar.init 100, PBarMode_Percent, "Calculating. Please wait..."
pbar.CurrentProgress = 15
DoCmd.SetWarnings False
CurrentDb.Execute "QRY_INSERT_MKT_PRICE_INTO_FAIR_VALUE_TABLE"
pbar.CurrentProgress = 30
CurrentDb.Execute "QRY_INSERT_FAIR_VALUE_BY_BENCHMARK_INTO_FAIR_VALUE_TABLE"
pbar.CurrentProgress = 50
DoCmd.OpenTable "MKT_FAIR_VALUE", acViewNormal, acReadOnly
DoCmd.SetWarnings True
End Sub
DoCmd.OpenTable "MKT_FAIR_VALUE", acViewNormal, acReadOnly
ongke0711 > 13-12-17, 12:14 PM
killitmore > 13-12-17, 03:04 PM
(13-12-17, 12:14 PM)ongke0711 Đã viết: Không ai mở table cả. Đưa nó vô Form rồi mở lên nhé.
duynamvnn1208 > 13-12-17, 04:22 PM