forms vs reports

humer

Registered User.
Local time
Today, 22:27
Joined
Feb 10, 2004
Messages
14
A new problem: I want to change the visibility of some fields in the report from the same form. I made some checkboxes in the form for selection of the fields that I to view in the report. By default the fields from the report are invisible.

Here is the code that change the visibility, but it doesn't work. it is placed after the code that open the report.
the form where are the checkboxes: export, the report which is opened: Projects

If (Forms![Export]![state].Value) Then
Report.[Projects].[Project State].Visible = True
End If

at end is a messagebox:
title: Microsoft Office Access
Message: Object required
 
Are you sure you've got your object names correct?

If so, try:
Report("Projects")("Project State").Visible=Forms("Export")("state")

This assumes your report is called "Projects", your form is called "Export" and the checkbox is called "state".

You might want to check out Mile's post on naming conventions: Naming things on a form, as well as my own article on referring to objects: Referring to objects in Access
 

Users who are viewing this thread

Back
Top Bottom