In this chapter we've looked at how you use code in reports. This varies from just using functions in fields to using events and larger sections of code in the code module behind the report. Even at its very simplest, you can see that adding code to reports can make a difference.
The important things to consider are:
You can use expressions as the ControlSource of a field, just by placing an = sign in front of the expression.
You can use the Format event to allow you to change the layout of reports, such as making fields visible, or changing the formatting of a field.
You can use the Open and Close events to trigger other actions, such as loading a form.
You probably won't use much code in your reports, just limiting it to the samples shown here. Now that you've seen code behind both forms and reports, it's time to look at a little advanced programming.