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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Currency symbol 1

Status
Not open for further replies.

XP2000

Programmer
Dec 14, 2001
40
GB
I produce invoices using a standard Access report. Several fields are in currency format.
Can I make the currency format conditional so that if the invoice is for a UK company the currency symbol displayed is '£' and if the invoice is for USA company the currency symbol displayed is '$'?

I have a field on this report called [Country] which is set to either 'UK' or 'USA'.

Many thanks,
Neil
 
Paste this in you OnFormat procedure:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Country = "UK" Then
'Format UK currency
Amount.Format = Chr(163) & " #,##0.00;(" & _
Chr(163) & " #,##0.00);" & _
Chr(163) & " 0.00;" & _
Chr(163) & " 0.00"
ElseIf Country = "USA" Then
'Format USA currency
Amount.Format = "$ #,##0.00;($ #,##0.00);" & _
"$ 0.00;$ 0.00"
Else
'
End If

End Sub



Amount needs to be changed to whatever the name of the text box is. Should work fine, pls let me know if it doesn't.


 
Many thanks...works a treat.
Have a tick on me.
Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top