What have I done wrong? Thanks in advance
Private Sub Report_Load()
If IsNull(Me.TagExpDate) Then
Me.Label28.Visible = True
Else
Me.Label28.Visible = False
End If
End Sub
What have I done wrong? Thanks in advance
Private Sub Report_Load()
If IsNull(Me.TagExpDate) Then
Me.Label28.Visible = True
Else
Me.Label28.Visible = False
End If
End Sub
I don't know - what does 'wrong' mean? Do you get an error message? If so, what is the message?
You only need
Label28.Visible = Isnull(tagexpdate)
and you may need it in ONPRINT event
Sorry -
forgot to say it (appears) not firing. I have 3 records in the report have no value in the TagExpDate field. I have Label28 in the detail section with caption as "non-expiring" that should display for the 3 records. Thought maybe I screwed up the event procedure or maybe using the wrong event.
On load event happens once, don't you want it in the detail event so it fires on each record?
OnLoad only fires once, as ranman256 said, and formatting in that event will be based on the state of the first Record displayed. If the first Record dictates that Label28.Visible = True...then that's how it will display for all Records...and vice versa; if the first Record dictates that Label28.Visible = False, then that's how it will display for all Records!
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007
Yes that would certainly cause the problem but where is the detail event? Can't find it.
Thanks for your patience...
As indicated in post #6, you may not be able to accomplish what you want, the way you are going about it. Perhaps building a query that employs an alias would be beneficial. Rather than a label, use a control bound to the alias in your query. SQL in the query can show or hide whatever characters would normally be displayed in your label.
Found it! (never used it before) and it's working fine in print preview.
Forgot to say that it will only work in print preview