Label Visibility

B

BillA

What I thought was simple is starting to give me a headache.

Working with a form, I have a label assigned to a text box. The text box
source is a field (field: ApprovalDate) that I'm using only the month
(DatePart function and formatted mmmm) to give me an anniversary date of the
approved date. This field may or may not have a data entered.
I would like to have the label to this text box be visible only if there is
data in this field. The text box is named RenewalAnniversary. The label
named RenewalAnniversaryLabel.

Thank you for any advice.
Bill
 
B

BillA

Realized I didn't state the version I am working with.
Access 2003, and it is a single form.

Thanks,
Bill
 
B

BillA

Sorry about confusing the issue.
[the Control Source for this text box reads: =DatePart("m",[ApprovalDate])]
Your suggestions have me thinking the most straight forward solution is to
make the text box (named RenewalAnniversary) and it's label be visible only
when it's source - ApprovalDate has data.
So the question is how to make a text box visible when there is data,
otherwise remain invisible. Also, I am not 'enabling' changes to this text
box, if that has any bearing on my problem.

Thanks again,
Bill
 
B

BillA

I've figured out my problem (I hope) the following code placed in the form's
"On Current" event has given me what I was looking for.

Private Sub Form_Current()
Me.RenewalAnniversary.Visible = Not IsNull(Me.ApprovalDate)
End Sub

With the (RenewalAnniversary) text box visible set to 'no' this code works
for me.

Thanks,
Bill

BillA said:
Sorry about confusing the issue.
[the Control Source for this text box reads: =DatePart("m",[ApprovalDate])]
Your suggestions have me thinking the most straight forward solution is to
make the text box (named RenewalAnniversary) and it's label be visible only
when it's source - ApprovalDate has data.
So the question is how to make a text box visible when there is data,
otherwise remain invisible. Also, I am not 'enabling' changes to this text
box, if that has any bearing on my problem.

Thanks again,
Bill

Linq Adams via AccessMonster.com said:
"I have a label assigned to a text box. The text box source is a field
(field: ApprovalDate) that I'm using only the month (DatePart function and
formatted mmmm) to give me an anniversary date of the approved date. This
field may or may not have a data entered. I would like to have the label to
this text box be visible only if there is data in this field. The text box
is named RenewalAnniversary. The label named RenewalAnniversaryLabel.

Re-reading your original post has given me a headache, too, Bill! Are you
saying that if

ApprovalDate

has data you want RenewalAnniversaryLabel visible, or are you saying that if


RenewalAnniversary

has data in it you want its label to be visible?
 

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