A
Albert
Hello,
I have a form with four fields: Name; CurrencyRate; txtAmount; txtConversion
I am displaying a list of foreign currencies in continuous form mode (saved
in tblCurrency).
I would like to have the user be able to enter a number into txtAmount and
get a conversion in U.S. dollars in txtConversion by using (CurrencyRate *
txtAmount) and have the form keep that amount until a new one is entered. I
would like to trigger the calculation from the AfterUpdate event on
txtAmount
Example
EUR 1.3 10 $13.00
JPY .8 15 $12.00
My problem is that in continuous form mode, all the lines are changing to
the new amount.
Example:
EUR 1.3 10 $13.00
JPY .8 10 $13.00
Any help would be appreciated!
Here is the code so far:
Private Sub txtAmount_AfterUpdate()
Dim strAmount As Double
Dim strConversion As Currency
strAmount = 0
strConversion = 0
strAmount = txtAmount
If strAmount = 0 Then
'do nothing
Else
strConversion = strAmount * Me.Rate
Me.txtConversion = strConversion
End If
End Sub
I have a form with four fields: Name; CurrencyRate; txtAmount; txtConversion
I am displaying a list of foreign currencies in continuous form mode (saved
in tblCurrency).
I would like to have the user be able to enter a number into txtAmount and
get a conversion in U.S. dollars in txtConversion by using (CurrencyRate *
txtAmount) and have the form keep that amount until a new one is entered. I
would like to trigger the calculation from the AfterUpdate event on
txtAmount
Example
EUR 1.3 10 $13.00
JPY .8 15 $12.00
My problem is that in continuous form mode, all the lines are changing to
the new amount.
Example:
EUR 1.3 10 $13.00
JPY .8 10 $13.00
Any help would be appreciated!
Here is the code so far:
Private Sub txtAmount_AfterUpdate()
Dim strAmount As Double
Dim strConversion As Currency
strAmount = 0
strConversion = 0
strAmount = txtAmount
If strAmount = 0 Then
'do nothing
Else
strConversion = strAmount * Me.Rate
Me.txtConversion = strConversion
End If
End Sub