A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

control visible



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2006, 05:38 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
00MichaelJordan
external usenet poster
 
Posts: 4
Default control visible

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.


  #2  
Old December 14th, 2006, 06:31 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
Larry Linson
external usenet poster
 
Posts: 3,112
Default control visible

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


"00MichaelJordan" wrote in message
...
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.



  #3  
Old December 14th, 2006, 06:51 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default control visible

On Thu, 14 Dec 2006 12:38:51 +0800, 00MichaelJordan wrote:

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.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old December 14th, 2006, 06:59 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default control visible

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,

"00MichaelJordan" wrote:

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.



  #5  
Old December 14th, 2006, 02:49 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default control visible

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.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

  #6  
Old December 15th, 2006, 05:11 AM posted to microsoft.public.access.forms
00MichaelJordan
external usenet poster
 
Posts: 4
Default control visible

I think this is helpful and I can deal with it from here. Thanks.

"missinglinq via AccessMonster.com" u28780@uwe wrote in message
news:6ac00f03c278a@uwe...
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.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.