Full Version: Report ControlSource and Format Function
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
bobdee
I pass an SQL statement from a form into a report. Why doesn't the following work:

Me.PERCENT_USE.ControlSource = "FORMAT(A.PERCENT_USE, '##0.00%')"

A parameter box is displayed when the report opens that says "Enter Parameter Value" and has the Format Expression immediately below it.

The Format expression in the ControlSource statement is exactly the way it appears in the SQL statement.

Thanks.
jleach
Hi,

In the query, "A" is apparently a source of some sort... in a controlsource I don't think it's recognizing that. You might remove the "A." part of that and wrap the field name in brackets to display what you need.

Another easier method may be to just apply the required format under the Format property of the control.

hth
theDBguy
Hi,

Jack probably understood your question better than I did but did you say you are getting this information from a form? If it's a control on a form, why not just refer to the control's name:

=Forms!FormName.ControlName

Or, if you really like to do it in code:

Me.PERCENT_USE = Forms!FormName.ControlName

Hope that helps...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.