I currently have the following code in my form:
For some reason, it does not work. It's giving me a syntax error message. Basically, I'm trying to get the exchange rate of one currency to another based on USD. Instead of full date, I am only using Month and Year. I divide one rate to usd with another using the correct month/year.
2B||!2B
Code:
Private Sub CurrentFXRate_GotFocus()
Dim dblMonth
Dim dblYear
dblMonth = Month([Date])
dblYear = Year([Date])
Me.CurrentFXRate.Value = DLookup("[RateToUSD]", "tblCurrencyRates", "CurrencyRateId = BaseCurrency _
AND Month(Date) = dblMonth AND Year(Date) = dblYear") / _
DLookup("[RateToUSD]", "tblCurrencyRates", "CurrencyRateId = PaymentCurrency _
AND Month(Date) = dblMonth AND Year(Date) = dblYear")
End Sub
For some reason, it does not work. It's giving me a syntax error message. Basically, I'm trying to get the exchange rate of one currency to another based on USD. Instead of full date, I am only using Month and Year. I divide one rate to usd with another using the correct month/year.
2B||!2B