Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

A formatted text box

Posted on 1998-06-09
2
Medium Priority
?
143 Views
Last Modified: 2010-05-03
I need a data-bound text box that shows DAO data from the JET engine formatted as required i.e format(foo,"###0.00").
I have tried to set the Access format value when designing the database but the values come back raw. The Masked Text control NEARLY works but is left formatted, I also need the ability to have the control locked when required.
0
Comment
Question by:entretec
2 Comments
 
LVL 2

Accepted Solution

by:
swilt earned 150 total points
ID: 1462872
Use a text box with Alignment set to 1 - Right Justify and the following piece of code

Private Sub Text1_Change()
    Static bInHere As Boolean
   
    If Not bInHere Then
        bInHere = True
        Text1.Text = Format$(Text1.Text, "#0.00")
        bInHere = False
    End If
End Sub


If you do Text1.Enabled = False this code still works
0
 

Author Comment

by:entretec
ID: 1462873
Thanks, what I was really looking for was a control  rather than having to put this code in every text box. However I suppose I could create a user-control.

Mike
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

916 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