Setting a control to Visible=False

D

dhstein

I sometimes want to run a program that sets a text box to visible = true,
allows user input and then sets the control to visible = false. Since I
can't set the active control to visible = false, I pick another control, set
the focus there first, and then set the original control to visible = false.
But this seems a little messy, because then the user is pointing to a control
that he didn't pick. Is there a better way of doing this? Thanks for any
help on this.
 
D

Douglas J. Steele

To be honest, I don't see why you're concerned that "the user is pointing to
a control that he didn't pick". Since the control which he did pick is no
longer visible, where would you have focus be instead?
 
J

John Spencer

You could add a transparent button with no action and set the focus to
the button.

Or you could add an unbound control and set its size to 1 twip by 1 twip
and set the focus there.

Or you could set the focus to the next or previous control in tab order

Or you could keep track of the last control to have the focus (except
for the one that you are using) in a form level variable and set the
focus back to the last control.

But, you do have to set the focus someplace.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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

Top