Hi,
First, add a Label to the form. (You could use a text box, but then the user would have the capability of changing the contents, unless you set the "locked" property.)
You can set the caption property of the label to the report field, but remember that the report must be "alive". In other words, once the report is closed, the group average text box contents are gone. The best place to set the caption propery is in VBA code.
Here is what the code will look like, presuming you are using the same form to run the report:
When you run this report, you will see the information appear on the report. If you minimize this report and jump back to the form, you will see the value from the report.
You can do comparisons on this object with regular VBA code, e.g.,
If lblAverage > txtUserInput Then
MsgBox "The average found on the report is greater than your input"
End If
If this tip has been helpful, be sure to click on the "Mark this post as a helpful/expert post!".
Move any calculations to the query behind the report. Then either use that query for the form or copy and paste the relevant field into the query behind the form.
Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995
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.