Visbile Label

AmyLynnHill

Registered User.
Local time
Today, 10:33
Joined
Dec 7, 2005
Messages
81
I have a form that displays 1000 records. On the form is an option button "do not Contact". when it is toggled on (-1) I want a label to be visible(properties are set to visible=no).

Here is my code
Private Sub Option369_Click()
If DoNotCommWithGrp.Value = -1 Then
Me.DoNotContactLbl.Visible = True
Else
Me.DoNotContactLbl.Visible =False
End If
End Sub

The problem is the label appears on all the records on the form once it is toggled on/off. I only want it to appear for the records that has the option button selected.

What I'm I doing wrong?
 
you need to have this visible field in the table, so it is a bound control, not a unbound control

a continuous form is really displaying just one row repeatedly - so if the checkbox is not bound, the same value is shown on every row.
 
I am reading the problem different to Dave.

Firstly, as Dave says the control will need to be bound.

But the label will be visble or invisible for all the records.

The only way I can think of is to replace label with a textbox and then apply conditional formatting to the the textbox. By selecting the same colour backgroun as the form and selecting the same for the font that will make it invisible, assuming you have the border set to transparent.
 
Thanks for the responses.
I added the field to the form as a bound field, txt.
I'm confused on where to put the conditional format
would it be something like ....on the click event.

If checkField = -1 then
boundField.backcolor = whatevercolor?
endif
 
Right click on the textbox and bring up conditional formatting.

You will then see a couple of choice such as an expression etc so enter that and then select the colours from the right side.

You will also get to conditional formatting of you click on the textbox and then Format from the toolbar. If you A2007 it might be different.
 

Users who are viewing this thread

Back
Top Bottom