Solved

Change Dot for comma vb6

Posted on 2010-09-18
5
749 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 92

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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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