By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

Decimal Formatting in Details Section of Report

P: 1
I have a report that is grouped by a field called DataSource. In the detail section of the report where the record data fields are displayed, such as Jan, Feb, Mar, etc, I want to format the decimal places to 2 if the DataSource is Rate and 0 decimal places for any other value in DataSource. Is this possible and if so, how? Thanks in advance.
Jan 24 '09 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 8,638
In the Group Header's Format() Event, try:
Expand|Select|Wrap|Line Numbers
  2. Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
  3. Dim TBox As TextBox
  4. '
  5. Set TBox = Me![DataSource]
  6. '
  7. If TBox = "Rate" Then
  8.   TBox.Format = "#,#,#.00"
  9. Else
  10.   TBox.Format = "#,#,#"
  11. End If
  12. End Sub
Jan 25 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.