Showing Group Delimiter in text field

R

Rob F

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top