+ Reply to Thread
Results 1 to 2 of 2

Showing Group Delimiter in text field

  1. #1
    Rob F
    Guest

    Showing Group Delimiter in text field

    Hi

    I've got a VBA form which has a number of text boxes for entering integers.

    However, when inputting 100000 it doesn't look much different from 1000000.
    Once the data is processed it's easy to format the number to show e.g
    1,000,000 using FormatNumber.

    But is there any way to show the number in the box after updating with the
    group delimiters, but still retain the underlying value for manipulation once
    a command is run?

    I tried using:
    Private Sub txtBox_AfterUpdate()
    txtBox.Value = FormatNumber(txtBox.Value, 0, , -1)
    End Sub

    This worked fine in the box, e.g. it showed 10000 as 10,000. But when it
    came to processing the txtBox.Value was only 10, i.e. it knocked off
    everything after the first delimeter.

    Any advice much appreciated.

    Rob F

  2. #2
    Tom Ogilvy
    Guest

    Re: Showing Group Delimiter in text field

    Maybe use Cdbl to do the converison

    dblVal = cdbl(txtbox.value)

    --
    Regards,
    Tom Ogilvy

    "Rob F" <RobF@discussions.microsoft.com> wrote in message
    news:42A48F6A-80C6-4B2A-953A-8D63E9D0A21E@microsoft.com...
    > Hi
    >
    > I've got a VBA form which has a number of text boxes for entering

    integers.
    >
    > However, when inputting 100000 it doesn't look much different from

    1000000.
    > Once the data is processed it's easy to format the number to show e.g
    > 1,000,000 using FormatNumber.
    >
    > But is there any way to show the number in the box after updating with the
    > group delimiters, but still retain the underlying value for manipulation

    once
    > a command is run?
    >
    > I tried using:
    > Private Sub txtBox_AfterUpdate()
    > txtBox.Value = FormatNumber(txtBox.Value, 0, , -1)
    > End Sub
    >
    > This worked fine in the box, e.g. it showed 10000 as 10,000. But when it
    > came to processing the txtBox.Value was only 10, i.e. it knocked off
    > everything after the first delimeter.
    >
    > Any advice much appreciated.
    >
    > Rob F




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1