Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

data format problem from access through vb6

hi
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.
raza
0
helloraza
Asked:
helloraza
  • 2
  • 2
1 Solution
 
Wayne Taylor (webtubbs)Commented:
To display any number with a trailing zero, you need to convert it to a string....

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

Wayne
0
 
hellorazaAuthor Commented:
thanks

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.
regards.
raza
0
 
Wayne Taylor (webtubbs)Commented:
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.
0
 
hellorazaAuthor Commented:
ok
got it.
many thanks for prompt reply.
ragards.
raza

0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now