[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


data format problem from access through vb6

Posted on 2009-04-06
Medium Priority
Last Modified: 2013-12-25
i am using vb6 with ms acces 2003. i have a field in database with data type "NUMBER" format "CURRENCY" and decimal places "3". in access data is shown with currency symbol and with accurate decimal places.
Problem is , when i try to show the data in a textbox, it just truncate the last zero.
suppose if amount is "23.230" , it shows "23.23".
i have set the data formate property of text box to "CURRENCY".
I CHECKED by putting beak point where recoredset is assigining value to textbox like this

textbox1.text=rs![myamount], it is showing value "23.23" over there as well.
so may be its record set problem or text box.

could please any body guide me for this.

thanks and regards.
Question by:helloraza
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
  • 2
  • 2
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24075571
To display any number with a trailing zero, you need to convert it to a string....

    textbox1.text=Format(rs![myamount], "$#,##0.000")


Author Comment

ID: 24075949

but i was thinking to display as many zeros as the data have, only wondering why it does not show zeros if they are present in database field?

thanks for your reply anyway.
LVL 48

Accepted Solution

Wayne Taylor (webtubbs) earned 500 total points
ID: 24075962
The field in the database has it's format set to *display* 3 decimals, but they are not stored that way. They are stored as numbers, without the trailing zeros.

Author Closing Comment

ID: 31566942
got it.
many thanks for prompt reply.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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