Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2003
    Location
    Bad Voeslau, Austria
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting user fields (2000/2002/2003)

    There is no problem inserting user fields from the 20 number fields. No problem again in creating (simple) formulae. But I cannot manage to assign a useful number format, like a specific number of decimals, a thousands separator, or a Currency symbol.
    There are "functions" given in the field properties dialogue, like "CCur" or "CDec" - CCur does _not_ result a currency, and CDec creates an error ...
    Trying VBA directly gives me "FormatNumber", but again does not work. The help for "Format" shows details for Date formatting, but regarding numbers refers to "named formats" or "user defined formats", so I tried the Excel scheme ("#.##0,00") - no error, but no resulting format either?
    Is there a way?

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Formatting user fields (2000/2002/2003)

    I don't think you can change the format of a custom field as they are already in a pre-defined format. (Not saying it can't be done but I don't know how). If you want to use currency then you should use the cost custom field. The text fields are pre-defined alphanumeric.

    Please post back if you determine a way to do this.

    I can change the values of the custom fields in code but don't know how to change their type.
    Regards,

    Gary
    (It's been a while!)

  3. #3
    New Lounger
    Join Date
    Sep 2003
    Location
    Bad Voeslau, Austria
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting user fields (2000/2002/2003)

    It is not only currency formatting I need - and even there the standard cost fields would not always help, as I sometimes need to show not only Euros, but the conversion to other (local) currencies, which I convert by a formula from the cost fields to one of the custom fields. Other common uses are weights, lengths, etc. All this might be shown in the column head, but at least the numbers should be readable (thousands sep.) and show a specific number of decipoints!
    Maybe I will find something, or someone else - meanwhile I have to stick to exporting to Excel and do reports there - truly a "professional" program!

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Formatting user fields (2000/2002/2003)

    The only workaround I can think of at this time is to probably do what you are doing. If you want to depict the data in the Text1 field as currency in the format $0.00 then you could use a formula to do this. For example, put the values in the Text2 field and in the Text1 field use a formula such as CCur([Text2]) to convert the data after it is entered. I will post back if I can figure out a different way to do this.
    Regards,

    Gary
    (It's been a while!)

  5. #5
    New Lounger
    Join Date
    Sep 2003
    Location
    Bad Voeslau, Austria
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting user fields (2000/2002/2003)

    Thanks Gary, you gave me a valuable tip:
    Number Formatting *does* work - in Text fields!!!
    Mostly, anyway. I tried: CCur([cost]) - got the Windows Currency format, however the value was divided by 100. Tried CDec([cost]) got a syntax error, tried CDec([cost];2) and got a zero, no error. Then tried Format(cost;"#,##0.00") - worked a charm! Interesting: Format does not ask for square brackets, the others did.
    For those wanting to copy this: remember that I use a German Windows setting (dec. comma, thou point, list sep semicolon), but in spite of that the formatting template needs the english version (dec. point, thou. comma), tlist separator is still semicolon ...

  6. #6
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Formatting user fields (2000/2002/2003)

    Glad I could help. Thanks for posting back with how you solved your problem so others can benefit. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •