Visible by code

  • Thread starter ladybug via AccessMonster.com
  • Start date
L

ladybug via AccessMonster.com

I have a form called sfrm_status_of_lif_notes. In this form there is a text
box called status. This text box is bound to a previous form.
In the Detail of the form I have a text box called approved_dt. I have the
visibility set to No.
I would like approved_dt only to be visible if the status is "Approved"

I tried this in the On Open event of the form:
Dim blnVisible As Boolean

blnVisible = (Me.status = Approved)

Me.approved_dt.Visible = blnVisible

It did not work.

Does anyone have any suggestions?
 
J

Jeanette Cunningham

Try the load event or the current event instead of the open event.

Jeanette Cunningham
 
L

ladybug via AccessMonster.com

I tried both. Neither worked.

Jeanette said:
Try the load event or the current event instead of the open event.

Jeanette Cunningham
I have a form called sfrm_status_of_lif_notes. In this form there is a
text
[quoted text clipped - 14 lines]
Does anyone have any suggestions?
 
J

Jeanette Cunningham

Are we talking about a text box on a continuous subform?
In that case, look into using conditional formatting.

Jeanette Cunningham

ladybug via AccessMonster.com said:
I tried both. Neither worked.

Jeanette said:
Try the load event or the current event instead of the open event.

Jeanette Cunningham
I have a form called sfrm_status_of_lif_notes. In this form there is a
text
[quoted text clipped - 14 lines]
Does anyone have any suggestions?
 
L

ladybug via AccessMonster.com

No, it is a single form

Jeanette said:
Are we talking about a text box on a continuous subform?
In that case, look into using conditional formatting.

Jeanette Cunningham
I tried both. Neither worked.
[quoted text clipped - 7 lines]
 
J

Jeanette Cunningham

On sfrm_status_of_lif_notes
--in design view set the visible property of approved_dt to No
--in the load event of the form put code like this:
--the open event is too early to test the value of approved_dt
--assuming that approved_dt is text data type

If Me.approved_dt = "approved" Then
Me.approved_dt.Visible = True
Else
Me.approved_dt.Visible = False
End If

Jeanette Cunningham


I have a form called sfrm_status_of_lif_notes. In this form there is a text
box called status. This text box is bound to a previous form.
In the Detail of the form I have a text box called approved_dt. I have the
visibility set to No.
I would like approved_dt only to be visible if the status is "Approved"


ladybug via AccessMonster.com said:
No, it is a single form

Jeanette said:
Are we talking about a text box on a continuous subform?
In that case, look into using conditional formatting.

Jeanette Cunningham
I tried both. Neither worked.
[quoted text clipped - 7 lines]
Does anyone have any suggestions?
 
L

ladybug via AccessMonster.com

I tried your steps and your code, no luck.
What do you mean assuming that approved_dt is text data type. It is a text
box, but in the table is set to date/time data type. Will this not work
unless it is text?
Thank you so much for trying to help me.

Jeanette said:
On sfrm_status_of_lif_notes
--in design view set the visible property of approved_dt to No
--in the load event of the form put code like this:
--the open event is too early to test the value of approved_dt
--assuming that approved_dt is text data type

If Me.approved_dt = "approved" Then
Me.approved_dt.Visible = True
Else
Me.approved_dt.Visible = False
End If

Jeanette Cunningham

I have a form called sfrm_status_of_lif_notes. In this form there is a text
box called status. This text box is bound to a previous form.
In the Detail of the form I have a text box called approved_dt. I have the
visibility set to No.
I would like approved_dt only to be visible if the status is "Approved"
No, it is a single form
[quoted text clipped - 8 lines]
 
D

Douglas J. Steele

If approved_dt is a date/time field, it cannot have a value of "approved":
it can only contain valid dates (or Null).

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


ladybug via AccessMonster.com said:
I tried your steps and your code, no luck.
What do you mean assuming that approved_dt is text data type. It is a
text
box, but in the table is set to date/time data type. Will this not work
unless it is text?
Thank you so much for trying to help me.

Jeanette said:
On sfrm_status_of_lif_notes
--in design view set the visible property of approved_dt to No
--in the load event of the form put code like this:
--the open event is too early to test the value of approved_dt
--assuming that approved_dt is text data type

If Me.approved_dt = "approved" Then
Me.approved_dt.Visible = True
Else
Me.approved_dt.Visible = False
End If

Jeanette Cunningham

I have a form called sfrm_status_of_lif_notes. In this form there is a
text
box called status. This text box is bound to a previous form.
In the Detail of the form I have a text box called approved_dt. I have
the
visibility set to No.
I would like approved_dt only to be visible if the status is "Approved"
No, it is a single form
[quoted text clipped - 8 lines]
Does anyone have any suggestions?
 
L

ladybug via AccessMonster.com

I got it! I just changed Me.approved_dt to Me.status on your code

The status is trigger on whether the approved date should appear. Thank you
so much for your help!
If approved_dt is a date/time field, it cannot have a value of "approved":
it can only contain valid dates (or Null).
I tried your steps and your code, no luck.
What do you mean assuming that approved_dt is text data type. It is a
[quoted text clipped - 30 lines]
 

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