[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change Dot for comma vb6

Posted on 2010-09-18
5
Medium Priority
?
769 Views
Last Modified: 2012-08-13
Hello all,

I would like to know what i could do, only in one textbox, that if somedoby pless on the Dot "." , it put a comma automatically ","

How can i do this please?

Thanks for your help
0
Comment
Question by:Wilder1626
5 Comments
 
LVL 9

Expert Comment

by:TonyReba
ID: 33708549
can you post a part of the code so we can take a look ?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 33708569
Sure

Private Sub txtCout_unitaire_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
txtCout_unitaire.Text = Format(txtCout_unitaire.Text, "Currency")
End Sub
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 33708910
Try this:
Private Sub txtCout_unitaire_KeyPress(KeyAscii As Integer)

    If KeyAscii <> 46 Then
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    Else
        KeyAscii = 44
    End If
    txtCout_unitaire.Text = Format(txtCout_unitaire.Text, "Currency")

End Sub

Open in new window

0
 
LVL 22

Accepted Solution

by:
danaseaman earned 2000 total points
ID: 33710213
Or just:

Private Sub Text1_KeyPress(KeyAscii As Integer)
   If KeyAscii = 46 Then
      KeyAscii = 44
   End If
End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 33711387
That is perfect.

Thanks a lot for your help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question