The reason I want to do it in code is:
The report needs to be viewed with the decimal places when balancing the report to its source but the decimal places are not needed when printed as "Final". I'm trying to set up an if statement that looks at a check box and determines the format property at run time. I'm aware of how to do it at design time.
pcdaveh,
Here's what I would do in this instance. There may be an easier way, but this is what comes to mind..
- set up an invisible field on the form, which is bound to the value of the field. Let's name it txtFieldValue. Be sure it's in the same report section that you want the field to be displayed.
- make the visible field unbound. Let's call it txtDisplayValue.
- in the code (in the "Format" event of whichever area that contains the textbox in question) (assuming the checkbox you referred to is called "chkFinal":
If chkFinal = True Then
txtDisplayValue.Value = _
Format(txtFieldValue.Value, "###,##0"
Else
txtDisplayValue.Value = _
Format(txtFieldValue.Value, "###,##0.00"
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.