Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    5

    Excel number format not working in Access

    Hello,

    I am using Access 2002 SP3 and Excel 2002 SP3. I have come up with the following format, which I need for a particular application:

    [>=10000000][$Rs.-4009]##\,##\,##\,##0.00;[>=100000][$Rs.-4009]##\,##\,##0.00;[$Rs.-4009]##,##0.00

    The above format, when used in Excel, displays a number with commas placed based on the Indian number system, two decimal places, and "Rs." prefixed to the number (to indicate the Indian currency "Rupees"). For instance,

    10000000 gets displayed as Rs.1,00,00,000.00

    This works consistently in Excel. When I copy and paste this format into the format box corresponding to an Access table field and hit enter, however, Access automatically converts my format into

    >\["=10000000]""[$Rs.-4009]##,##,##,##0.00";>\["=100000]""[$Rs.-4009]##,##,##0.00";\["=10000000]""[$Rs.-4009]##,##,##,##0.00"



    which obviously doesn't work. This happens irrespective of whether I set the data type for the field to be Currency or Number. Could someone suggest a way for me to get the formatting I want in Access?

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Posts
    5
    Any ideas? I'd much appreciate help with the issue I've described above.

    Thanks!

  3. #3
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    To workaround, write a string function instead
    Code:
    Function RCur(a)
        If a >= 1000 Then
           RCur = "Rs " & Format(a, "##\,##0.00")
        End If
        If a >= 100000 Then
           RCur = "Rs " & Format(a, "##\,##\,##0.00")
        End If
        If a >= 10000000 Then
            RCur = "Rs " & Format(a, "##\,##\,##\,##0.00")
        End If
    End Function

  4. #4
    Join Date
    Mar 2009
    Posts
    5
    Quote Originally Posted by thhui View Post
    To workaround, write a string function instead
    Code:
    Function RCur(a)
        If a >= 1000 Then
           RCur = "Rs " & Format(a, "##\,##0.00")
        End If
        If a >= 100000 Then
           RCur = "Rs " & Format(a, "##\,##\,##0.00")
        End If
        If a >= 10000000 Then
            RCur = "Rs " & Format(a, "##\,##\,##\,##0.00")
        End If
    End Function
    Thanks for your input, thhui. I've abandoned the idea of getting this formatting in my tables, and resigned myself to just getting it in my forms. I haven't started working on the latter, but when I do, I'll probably find myself using your algorithm.

    Thanks again!

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

Similar Threads

  1. Open / Save as Excel File and specifiy format
    By jaykappy in forum Access
    Replies: 8
    Last Post: 03-24-2009, 03:26 PM
  2. Replies: 0
    Last Post: 01-06-2009, 03:27 PM
  3. Access VBA - date format conversion
    By benattal in forum Programming
    Replies: 3
    Last Post: 12-22-2008, 10:40 AM
  4. Access Runtime 2007 Date Time Picker Vista not working
    By sailinxtc in forum Programming
    Replies: 0
    Last Post: 09-17-2008, 12:56 PM
  5. Email created from Access is in the wrong format
    By Stick in forum Programming
    Replies: 0
    Last Post: 09-25-2006, 12:48 PM

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