Thread: control visible
View Single Post
  #5  
Old December 14th, 2006, 01: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