Results 1 to 11 of 11
  1. #1
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15

    Supporting multiple currencies in access form

    All,

    I've been trying to find an answer to this, but so far have not. I have 3 fields in my db, valueUSD, ValueOther, Currency. Obviously, valueUSD will always be shown in the US Dollar format $#,###.## however, I want to create VBA code so that when the user selects a specific currency (i.e. GBP or EUR), the number in ValueOther is formatted using the correct currency symbol.

    Any suggestions?

    Thanks
    Mike

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    And what level of accuracy do you hope to have and maintain /retain?
    There are online currency exchanges that may offer some help, but exchange rates vary with time.
    Perhaps you could tell us more of the proposed application.

  3. #3
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15
    Thanks for your reply. I am not looking for the program to do the actual currency conversion. The user will enter in the specific amount, I just want the value field to format the number with the correct currency indicator, when they indicate GBP the number is prepended with £ and if they select EUR, the value is prepended with €. So it is really how do I change the format of the field based on the currency selected.

    Thanks
    Mike

  4. #4
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    The Currency default format is controlled by your computer's Locale. If you want to use something other than the default, then you will have to build it using the Format() Function or use a custom Input Mask Property on the Form Controls.

  5. #5
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15
    Thanks Rawb. I have tried using the Fromat() command in VBA, keep getting mismatch errors. Here is the test code;

    If [currency] - "GBP" Then
    [valueother] = Format([valueother], "£#,###.##")
    End If

    valueother is set as currency in the table format.

    Thanks
    Mike

  6. #6
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    That should be an equals sign, not a minus

    Code:
    If [currency] = "GBP" Then
    [valueother] = Format([valueother], "£#,###.##")
    End If

  7. #7
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15
    Sorry, that was a copy typo to here. It is an equal sign, but still getting a runtime error -2147352567 (800200009)

    Thanks

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    is [valueother] a bound control? if it is it has to be a text field or it won't accept the value you're trying to add. If you're storing a number value you would set the INPUT MASK to the string with the british pound sign in it.

    FORMAT changes a number to a string you just want it to display a certain way, not actually be stored as a string.

  9. #9
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15
    Thanks. Yes that works, but I need it to store in the data table with the right currency symbol. Sounds like that is not going to be an option here.

  10. #10
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    why would you need to actually store it with the symbol? you can display it in any output (queries, forms, reports) with the correct symbol.
    the bottom line is that if you store the symbol you're storing a text string, not a number.

  11. #11
    NJMike64 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    15
    ok, I understand. I just like to have it stored once instead of going through the formatting and additional unbound fields.

    Thanks
    Mike

Please reply to this thread with any new information or opinions.

Similar Threads

  1. different types of currencies
    By tommyried in forum Forms
    Replies: 3
    Last Post: 03-02-2014, 02:18 AM
  2. MS Access 2010 Multiple Search Form
    By tb199 in forum Access
    Replies: 17
    Last Post: 01-16-2014, 08:33 AM
  3. Access 2010 - Multiple Rows in Form w/ checkboxes
    By stevedefazio in forum Forms
    Replies: 4
    Last Post: 09-17-2013, 05:05 PM
  4. Object or class not supporting set of events
    By Glenn_Suggs in forum Access
    Replies: 10
    Last Post: 11-15-2012, 11:56 AM
  5. Replies: 13
    Last Post: 11-20-2010, 06:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums