Hide element in a report if value is Null

Alexander S.

Registered User.
Local time
Today, 10:09
Joined
Nov 9, 2014
Messages
10
Hello!

I have a report in which I'm trying to hide some elements from view in case a specific value is Null. Access seems to do this automatically if the report is in print-preview-mode, but not in normal view-report-mode.

I've tried something like this, but it's not really working:
Code:
private sub report_load()
	if nz(txtfield, 0) = 0 then
		txtfield.visible = false
	end if
end sub

Is there some way to achieve this, maybe?
 
It returns an error if I do that: "You can't change the value of this property in OnPaint event"
 
Why dont you filter out the null values in the report's record source query.
 
Yep, I've also tried this, but there is no visible change in the report - at least it's not an error.

I suspect it's not possible to dynamically change the visibility of an element from entry to entry. If that is the case, how could I solve this problem on the query level (as suggested by smig).
Thing is I don't want to hide the entry altogether, just one part of it.
 

Users who are viewing this thread

Back
Top Bottom