make a report text box invisible based on its value (1 Viewer)

3x3

New member
Local time
Today, 06:12
Joined
Apr 21, 2000
Messages
8
i have a macro that opens a report. Then the second line of the macro defines a value report!reportname!dateclosed.visble = false
with the condition statement report!reportname!dateclosed = null. In theory if the date closed is null then its text box on the report would be invisible. when i open the form the texts not visible if the value is null. However the text box is also not visable even if there is a value in the text box for date closed.
 
R

Richie

Guest
Not really sure what you are trying to do in the macro but the visible property for a control in a report belongs in the on format event and for a form in the current event
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:12
Joined
Feb 19, 2002
Messages
43,478
Move the code to the Format event of the report's detail section.

If IsNull(Me.DateClosed) then
Me.txtDateClosed.Visible = False
Else
Me.txtDateClosed.Visibie = True
End If

The DateClosed control needs a different name than the column name from the recordsource. I prefixed the name with "txt".
 

Users who are viewing this thread

Top Bottom