Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal Place of a Field

Status
Not open for further replies.

Stainnd

Programmer
Jul 9, 2001
65
0
0
US
I'm writing a program that creates a table w/ three fields. One of the fields is a currency field. However, I want the currency field to say $10.107473. I know that in design view in MS Access, you can edit the attributes of a currency field, but how do I do this w/ VB code? Thanks
-Mike
 
sorry to be a big pain but could u please be more specific? -Mike
 
Where ever you get the number from, such as text1.text or rs.field("whatever") you have to use the format function as follows:

Format(text1.text, "###.000000")

or

Format(rs.field("Whatever"), "###.000000")

I think the last will work but I haven't checked it.

The # sign is a place holder so the number will never go over 000.000000. If you want more than 3 numbers before the decimal just add another # sign.

The 0 means it will always be 6 (in this case) figures behind the decimal point

Hope this is what you were looking for
Robert Every day above ground is a GOOD DAY!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top