control visible

  • Thread starter Thread starter 00MichaelJordan
  • Start date Start date
0

00MichaelJordan

I tried to put a iif statement in a control visible attributte. It gives me
an error:

"the text you entered isn't an item in list"

PLease help. Thanks.
 
The Visible Property has two possible values: True and False. It doesn't
support expressions even if they evaluate to the valid values. You need to
put code in an appropriate event to set it.

Larry Linson
Microsoft Access MVP
 
I tried to put a iif statement in a control visible attributte. It gives me
an error:

"the text you entered isn't an item in list"

PLease help. Thanks.

I would suggest you be a bit more specific.
What does 'put an iif statement in a control visible attribute' mean?

Post the actual iif statement, where you placed it, as well as what
you expect to happen.
 
If you click in the property then press F1 it will bring up the help for that
item. You will find it is a boolean and only tru/false.
To change it you need an event or macro to write to the control,
 
We really need to see your code, but as a general rule the most common place
to hide/show controls is in the Form_Current sub, i.e.

Private Sub Form_Current()
If Me.MyTextBox.Value = "no" Then
MyCommandButton. Visible = False
Else
MyCommandButton. Visible = True
End If
End Sub

If you needed to hide the control as soon as an event occurred, say a value
was entered in MyTextBox, you could use something like this:

Private Sub MyTextBox_BeforeUpdate(Cancel As Integer)
If Me.MyTextBox.Value = "no" Then
MyCommandButton. Visible = False
End If
End Sub

If you do this, you will still need to use the first block of code above, in
order to reset the visibilty when moving to another record.
 
I think this is helpful and I can deal with it from here. Thanks.
 

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

Back
Top