How To Format String For Currency Format?

CharlesWhiteman

Registered User.
Local time
Today, 14:57
Joined
Feb 26, 2007
Messages
421
I have a txt box on my form set to currency format but the DLookup string seems to verride this. Does anyone know how ui can modify the string to be in currency format?

=DLookUp("Nz([Sumofamount received],0)","QryFinanceSumOfReceipts","CompanyCode = forms!frmDatabase!companycode")
 
Wrap the DLookup() in a Format() function.
 
Thanks, am not sure how to write it but will investigate
 
Where am I going wrong?

=DLookUp(Format(("Nz([Sumofamount received],0)","QryFinanceSumOfReceipts","CompanyCode = forms!frmDatabase!companycode"),"£#,##0.00"))
 
=DLookUp(Format(("Nz([Sumofamount received],0)","QryFinanceSumOfReceipts","CompanyCode = '" & forms!frmDatabase!companycode & "'"),"Currency"))

If the CompanyCode is numeric drop the quotation marks from the string
 
This is the syntax I've used but i keep getting an operator without an operand error and yes the companycode is a numeric field:

DLookUp(Format(("Nz([Sumofamount received],0)","QryFinanceSumOfReceipts","CompanyCode = " & forms!frmDatabase!companycode & "),"Currency"))
 
I would wrap the DLookup inside:

Format(DLookup(...), "Currency")
 
Yes! That worked great! Here's the syntax in case anyone has a similar question:

=Format(DLookUp("Nz([Sumofamount received],0)","QryFinanceSumOfReceipts","CompanyCode = forms!frmDatabase!companycode"),"Currency")
 

Users who are viewing this thread

Back
Top Bottom