Run-time error ‘2471’ - The expression you entered as a query parameter produced the following error: ‘AUD’



I am recieving the Run-time error '2471' when running the following code in BOLD.  The first 2 DLookups work fine, just the third DLookup is erroring out.


Private Sub cboCurrency_AfterUpdate()

    Me.txtNetDate = Me.cboNetDate
    Me.txtRecParty = Me.cboRecParty
    Me.Username = Me.getuser1
Dim dblFuncCurrency
Dim dblFuncRate
Dim dblFXRate

dblFuncCurrency = DLookup("[FuncCurrency]", "qry_GetFuncCurr", "[CompanyID] = " & Me.cboRecParty)
Me.txtFuncCurrency = dblFuncCurrency

dblFuncRate = DLookup("[FXRate]", "qry_GetFuncCurr", "[CompanyID] = " & Me.cboRecParty)
Me.TxtFuncRate = dblFuncRate

dblFXRate = DLookup("[FXRate1]", "qry_GetFxCurr", "[FuncCurrency] = " & Me.cboCurrency)
Me.txtFXRate = dblFXRate

End Sub


Any suggestions would be greatly appreciated.



Question Info

Last updated June 27, 2018 Views 10,970 Applies to:
I suspect cboCurrency holds text values of currencies ? Like AUD (Australian Dollars) etc.

If this is the case the you need to put apostrophes around the matching currency

dblFXRate = DLookup("[FXRate1]", "qry_GetFxCurr", "[FuncCurrency] = '" & Me.cboCurrency & "'")

32 people were helped by this reply


Did this solve your problem?

Sorry this didn't help.