Thread: control visible
View Single Post
  #6  
Old December 15th, 2006, 04: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