Text box visible on a continuous form

O

Opal

Running Access 2003. I would like to make an
unbound textbox visible only when the value in
another text box is met. I have created a
continuous form with 5 bound checkboxes
and one bound text box called [StartAuto].
I want the unbound textbox to act as a border
around the 5 checkboxes and to be visible only
when the value in the [StartAuto] text box =
"All Safe in this Section"

I have tried:

Private Sub Form_Current()
If Len([StartAuto] & "") = "All Safe in this Section" Then
Me.Border5.Visible = True
Else
Me.Border5.Visible = False
End If

End Sub

And it does not work. I have tried conditional
formatting using an expression and it does not
work.

Can anyone help me achieve my goal?
Thank you.
 
P

Piet Linden

Running Access 2003.  I would like to make an
unbound textbox visible only when the value in
another text box is met.  I have created a
continuous form with 5 bound checkboxes
and one bound text box called [StartAuto].
I want the unbound textbox to act as a border
around the 5 checkboxes and to be visible only
when the value in the [StartAuto] text box =
"All Safe in this Section"

I have tried:

Private Sub Form_Current()
If Len([StartAuto] & "") = "All Safe in this Section" Then
    Me.Border5.Visible = True
    Else
    Me.Border5.Visible = False
    End If

End Sub

And it does not work.  I have tried conditional
formatting using an expression and it does not
work.

Can anyone help me achieve my goal?
Thank you.

Several minor problems here...
Len(string) returns a number... try IsNull([ControlName]) to see if
the control contains a value.
why not just use a rectangle with no fill to highlight the controls?
Then you can do something like:

Private Sub Form_Current()
Me.border5.visible = (Me.Controls("StartAuto").Value = "All
Safe in this Section")
End Sub

because the right-hand expression will always return either True or
False... no need to compare again to True/False.
 
O

Opal

Dale,

This was similar to what I was doing before
with the conditional formatting. However,
your input did the trick, thank you so much!

I just need to get the focus set to one of the
checkboxes.... I see what you mean about that!
 

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