|
-
Mar 11th, 2011, 12:50 AM
#1
Thread Starter
Member
Type of currency
Hi all
I have a small program.
For example: When I input data at textbox1.text="123456"
then textbox2.text will appear ="123.456"
How to solve.
Help me.
-
Mar 11th, 2011, 01:19 AM
#2
Re: Type of currency
One of several ways:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static intCount As Integer
Text2.Text = Text2.Text & Chr(KeyAscii)
intCount = intCount + 1
If intCount = 3 Then Text2.Text = Text2.Text & "."
End Sub
-
Mar 12th, 2011, 12:43 AM
#3
Thread Starter
Member
Re: Type of currency
Thanks Doogle.
I mean that. If I have textbox1=12345678 then textbox2=12.345.678
It is the same Type of currency
Pleasev help me
-
Mar 12th, 2011, 01:37 AM
#4
Re: Type of currency
I assume that '.' is your currency separator.
The easiest method might be to put some code in the LostFocus event of Text1
Code:
Private Sub Text1_LostFocus()
Text2.Text = Format(Text1.Text, "##.###.###")
End Sub
when you move the cursor out of Text1, Text2 should contain the formatted data
-
Mar 12th, 2011, 04:45 AM
#5
Re: Type of currency
You must use "," as thousand separator in Format() even your local thousand separator is "."
Code:
Text2.Text = Format(Text1.Text, "#,##0")
-
Mar 13th, 2011, 08:23 AM
#6
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|