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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying only decimal or whole part in a field

Status
Not open for further replies.

Gavroche00

Technical User
Feb 4, 2004
49
0
0
US
Sorry if this is the wrong forum, but I need to break down an amount in a report I am writing. Let say the amount is $1,045.34. I want it to read only the 1045 and then the 34. What is the format command for that please.

My Textbox will look like 'The amount of '&[whole]&'dollars and '&[decimal]&'cents'.

Thank you
 
Mid(Cstr([textfield]), 2, Instr(1, CStr([textfield]), ".") - 1)
will give you the dollars

and

Right(CStr([textfield]), 2)
will give you the cents


=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Or 'The amount of '& Int[Textfield]&'dollars and '& 100*([Textfield]-Int([Textfield])&'cents'.
Simon Rouse
 
Try a control source like:
="The amount of " & Int([NumFld]) & " dollars and " & Right(Format([NumFld],".00"),2) & " cents."

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thank you all very much, it worked both ways.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top