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.
 
D

Dale_Fye via AccessMonster.com

I don't usually recommend putting unbound controls in a continuous form,
because the properties you assign to that control will be displayed in all of
the records. However, the with conditional formatting you should be able to
get something to work.

I don't have 2003 on my computer anymore, so this might not work for you.

I'm using
I created a text box, and set its backcolor to the same as the detail section
of the form, and set its border style to transparent. I then adjusted its
position to "Send to Back" (don't remember if this is available in A2003).

I then selected the conditional formatting, and set the secondary format to
"Expression is".

I then set the expression to: [ID] < 4

and set the conditional formatting backcolor to Red.

when I opened the continuous form, those where the ID values was less than 4
had a red background, while those with a ID value of 4 or more did not APPEAR
to have a background.

The last thing you need to do is account for the chance that someone will
place thier cursor in the textbox. To do this, just use the GotFocus event
of the textbox and set the focus to one of the checkboxes that is displayed
over the textbox.

HTH
Dale
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.
 
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