Solved

Change Dot for comma vb6

Posted on 2010-09-18
5
730 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now