Invisible field on a report

ybg1

Registered User.
Local time
Today, 05:52
Joined
Jan 3, 2009
Messages
20
In a report on a certain condition i want the field to be invisible
and the code is :
If Me.Field1 = 1 then
Me.Field2.Visible = False
End if
But the problem is that when I type Me.Field2.
the word Visible doesn't appear on the list.

I use Access 2003.
 
A field is not really a visible object on a report. A report contains controls that may display data from fields that are present in the recordset that provides data to the report.
Can you find the object you refer to as Field2 on the report in design view? Right click and select 'Properties' if the property sheet is not open. The first text under the window title is Selection Type: What type of object is it?
 
Thanks a lot.

I've tried without a condition and found that the visible=false worked.

Than I made a condition that if the value is Null than visible=false ELSE visible=True.

Great stuff
 
Cool

Keep in mind that a boolean expression only has two states, true and false, so code like this ....
Code:
If someBooleanExpression = True Then
  SomeControl.Visible = True
Else
  SomeControl.Visible = False
End If
..can be much more simply expressed using ...
Code:
  [COLOR="Green"]'visibility varies directly with expression[/COLOR]
  SomeControl.Visible = someBooleanExpression
Cheers,
 

Users who are viewing this thread

Back
Top Bottom