I have a subform with controls ExpAmount,Avg_ConvRate, ExpAusDoll, etc.
Forex value is acquired from another crosstab query.
ExpAusDoll is product of ExpAmount and Avg_ConvRate.
The variables are declared in module level
When the following sub-procedure are run in successsion, it puts "0" in the ExpAusDoll contol on all records.
The value is not entered in the underlying table
***************************************************
Public Sub ConvExchRate()
'Opens, updates and minimises Exchange rate
Application.Echo False
DoCmd.SelectObject acQuery, "qryConvExchangeRate"
DoCmd.Requery
DoCmd.RepaintObject acQuery, "qryConvExchangeRate"
DoCmd.GoToControl "Avg_ConvRate"
ExRate = Avg_ConvRate
DoCmd.Minimize
Forms!frmTravel!sfrmExpense.SetFocus
Application.Echo True
End Sub
Public Sub Enter_AusDoll()
'Calculates and enters Aus Doll in ExpAusDol control
Application.Echo False
ConvExchRate
DoCmd.SelectObject acForm, "frmTravel"
DoCmd.GoToControl "TabCtlTravel"
DoCmd.GoToControl "sfrmExpense"
DoCmd.GoToControl "ExpAmount"
Amount = ExpAmount
DoCmd.GoToControl "ExpAusDoll"
ExpAusDoll =Amount* ExRate
Application.Echo True
End Sub
*******************************************************
Why?
Thanks in advance. Guru
Forex value is acquired from another crosstab query.
ExpAusDoll is product of ExpAmount and Avg_ConvRate.
The variables are declared in module level
When the following sub-procedure are run in successsion, it puts "0" in the ExpAusDoll contol on all records.
The value is not entered in the underlying table
***************************************************
Public Sub ConvExchRate()
'Opens, updates and minimises Exchange rate
Application.Echo False
DoCmd.SelectObject acQuery, "qryConvExchangeRate"
DoCmd.Requery
DoCmd.RepaintObject acQuery, "qryConvExchangeRate"
DoCmd.GoToControl "Avg_ConvRate"
ExRate = Avg_ConvRate
DoCmd.Minimize
Forms!frmTravel!sfrmExpense.SetFocus
Application.Echo True
End Sub
Public Sub Enter_AusDoll()
'Calculates and enters Aus Doll in ExpAusDol control
Application.Echo False
ConvExchRate
DoCmd.SelectObject acForm, "frmTravel"
DoCmd.GoToControl "TabCtlTravel"
DoCmd.GoToControl "sfrmExpense"
DoCmd.GoToControl "ExpAmount"
Amount = ExpAmount
DoCmd.GoToControl "ExpAusDoll"
ExpAusDoll =Amount* ExRate
Application.Echo True
End Sub
*******************************************************
Why?
Thanks in advance. Guru