If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Formatting for zero decimals
Hello, I'm using Access 2003 and trying to combine 2 fields, One value is
10000 and the other is bags and I want to display "10,000 bags" I have put this into the code of the report but I still need to format the value to not show decimal points, anyone know how to do this. Currently it show "10,000.00 bags" Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " & Me.txtFieldB Thanks |
#2
|
|||
|
|||
Formatting for zero decimals
Try a text box with Control Source of:
=Format([txtFieldA], "#,##0") & " " & [txtFieldB] IMHO, it would be much better to just display this, rather than to store it in txtFieldC. (Assumed the quantity will never be negative.) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Don" wrote in message news Hello, I'm using Access 2003 and trying to combine 2 fields, One value is 10000 and the other is bags and I want to display "10,000 bags" I have put this into the code of the report but I still need to format the value to not show decimal points, anyone know how to do this. Currently it show "10,000.00 bags" Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " & Me.txtFieldB Thanks |
#3
|
|||
|
|||
Formatting for zero decimals
Inline
"Allen Browne" wrote: Try a text box with Control Source of: =Format([txtFieldA], "#,##0") & " " & [txtFieldB] IMHO, it would be much better to just display this, rather than to store it in txtFieldC. He is displaying - (as far as what was written) (Assumed the quantity will never be negative.) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Don" wrote in message news Hello, I'm using Access 2003 and trying to combine 2 fields, One value is 10000 and the other is bags and I want to display "10,000 bags" I have put this into the code of the report but I still need to format the Report and not table. value to not show decimal points, anyone know how to do this. Currently it show "10,000.00 bags" Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " & Me.txtFieldB The txt should have been the clue - Usually txt goes in front of a text box and not a field name. Thanks |
Thread Tools | |
Display Modes | |
|
|