Hiding check box on report

V

Vaughan

My project report incorporates minutes from our weekly project meetings. I want to display a check box if the minute imposes an action, checked if complete and unchecked if not complete, but not to display the box at all if no action arises from the minutes.

My database contains a table with minutes as records, a yes/no field showing if there is an acion or not and another yes/no field showing if the action is complete or not. Basically, I want the check box not to appear on the report if the Action flag is "No", but the best I can get is a dimmed out box.

Any ideas?
 
M

Marshall Barton

Vaughan said:
My project report incorporates minutes from our weekly project meetings. I want to display a check box if the minute imposes an action, checked if complete and unchecked if not complete, but not to display the box at all if no action arises from the minutes.

My database contains a table with minutes as records, a yes/no field showing if there is an acion or not and another yes/no field showing if the action is complete or not. Basically, I want the check box not to appear on the report if the Action flag is "No", but the best I can get is a dimmed out box.


Just use a little code in the detail section's Format event
procedure:

Me.chkAction.Visible = (Me.chkAction = True)
 
V

Vaughan

Thanks Marshall

Actually this response has opened my eyes - I didn't even realize this was possible. Now I am teeming with ideas for making my reports even more flexible. Very helpful indeed.
 
B

BNicole

Marshall,

I used the code you prescribed, but everytime I try to open my report to
view it a message pops up reading "Microsoft office cannot find the macro
"Me". Am I doing something wrong? I have changed it to the name of the yes/no
column. Is there anything else I can do?
 
M

Marshall Barton

That is a line of VBA code that belongs in the section's
Format event procedure. The error message implies that you
tried to put it in the OnFormat property.

Select [Event Procedure] in the OnFormat property's drop
down list. Then click on the builder button [...] to get to
the event procedure.
 
B

BNicole

I am now getting a pop up that says "compile Error: Method of data member not
found" What am I doing wrong?

Marshall Barton said:
That is a line of VBA code that belongs in the section's
Format event procedure. The error message implies that you
tried to put it in the OnFormat property.

Select [Event Procedure] in the OnFormat property's drop
down list. Then click on the builder button [...] to get to
the event procedure.
--
Marsh
MVP [MS Access]

I used the code you prescribed, but everytime I try to open my report to
view it a message pops up reading "Microsoft office cannot find the macro
"Me". Am I doing something wrong? I have changed it to the name of the yes/no
column. Is there anything else I can do?
 
M

Marshall Barton

Difficult to say without seeing what you actually did.

While in the module, use the Debug - Compile menu item and
see if that at least highlights the line of code with the
error.

Did you change the name to your check box name?
 
B

BNicole

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) is
highlighted. The name of the checkbox is Site Survey. What do you suggest I
use as the formula/format.


Marshall Barton said:
Difficult to say without seeing what you actually did.

While in the module, use the Debug - Compile menu item and
see if that at least highlights the line of code with the
error.

Did you change the name to your check box name?
--
Marsh
MVP [MS Access]

I am now getting a pop up that says "compile Error: Method of data member not
found" What am I doing wrong?
 
M

Marshall Barton

BNicole said:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) is
highlighted. The name of the checkbox is Site Survey. What do you suggest I
use as the formula/format.


Me.[Site Survey].Visible = (Me.[Site Survey] = True)
 
L

Loren

BNicole said:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) is
highlighted.  The name of thecheckboxis Site Survey. What do you suggest I
use as the formula/format.

Me.[Site Survey].Visible = (Me.[Site Survey] = True)

I had the same error as BNicole, and the formula you provided worked
for my first check box, but applying this to subsequent checkboxes
caused the error "Ambiguous name detected:Detail_Format". Any thoughts
on what I am doing wrong?
My report is tracking units that have participated in exercises with
the unit names from left to right on the top as headers, and
vertically I have the type of exercise grouped with the dates it was
performed. Assuming I fix the problem with the check boxes, is it
possible to hide the headers that are associated with each checkbox?
Or do I need to tie those in with the checkboxes, and have them placed
in the "Detail" section with the checkboxes? Thank you in advance.

Loren
 
M

Marshall Barton

Loren said:
BNicole said:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) is
highlighted.  The name of thecheckboxis Site Survey. What do you suggest I
use as the formula/format.

Me.[Site Survey].Visible = (Me.[Site Survey] = True)

I had the same error as BNicole, and the formula you provided worked
for my first check box, but applying this to subsequent checkboxes
caused the error "Ambiguous name detected:Detail_Format". Any thoughts
on what I am doing wrong?
My report is tracking units that have participated in exercises with
the unit names from left to right on the top as headers, and
vertically I have the type of exercise grouped with the dates it was
performed. Assuming I fix the problem with the check boxes, is it
possible to hide the headers that are associated with each checkbox?
Or do I need to tie those in with the checkboxes, and have them placed
in the "Detail" section with the checkboxes? Thank you in advance.


It sounds like you copy/pasted the entire procedure when you
only needed to add another line to the existing procedure.

It sounds like the labels in the report/page header section
should always be there because any detail might have a
visible checkbox. Or maybe I don't understand what you want
with the labels.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top