Set property to visible

  • Thread starter Thread starter dhstein
  • Start date Start date
D

dhstein

How can I set a combo box property to visible in VBA ? Thanks for any help.
 
Chris O'C via AccessMonster.com said:
Use this syntax:

Me.comboboxname.Visible = True

Chris



--
Message posted via AccessMonster.com


Thanks - that worked. Now I'd like to set the visible property to False after the Control loses focus - but the Lost focus event seems to not be doing the trick - I get a message that you can't hide a control that has the focus. So I'm using the ComboBox to perform some commands and then I'd like to set it to not visible again. Thanks for any ideas.
 
Chris O'C via AccessMonster.com said:
Are you sure you want the combo box to go invisible right after the user
makes his/her change? What if they made a mistake and want to change it?
The combo box is gone. That's not user friendly.

If you must make it invisible, use this syntax in the lost focus event of
every control on the form able to get the focus:

If (Screen.PreviousControl.Properties("Name") = Me.comboboxname.Name)
Then
Me.comboboxname.Visible = False
End If

Chris
 

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