Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable in subforms

Status
Not open for further replies.

Mahathma

Technical User
May 13, 2002
17
0
0
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top