Bring to front

  • Thread starter Thread starter Jan
  • Start date Start date
Jan said:
Hi,
How do you bring a control on a form "to the front" in VBA.

In design view? Select the control (either by clicking on it or, if
it's hidden, by choosing it in the "Object" dropdown list), and then
click Format -> Bring to Front.

If you mean something else, please explain in more detail.
 
Hi Dirk,
I'm sorry. I didn't explain very well. The form is in form view and
involves several controls that I overlap and I want to bring them to the
front when a certain control has the focus. (I know it doesn't sound like
good design but this is what the client wants).

In a more detailed explanation, when a certain control has the focus, the
corresponding memo field must come to the front for editing etc. Any
thoughts?

Thanks for the prompt response.
Jan
 
Jan said:
Hi Dirk,
I'm sorry. I didn't explain very well. The form is in form view and
involves several controls that I overlap and I want to bring them to the
front when a certain control has the focus. (I know it doesn't sound like
good design but this is what the client wants).

In a more detailed explanation, when a certain control has the focus, the
corresponding memo field must come to the front for editing etc. Any
thoughts?

I believe you would have to toggle the visible properties instead. I don't
think you can control the Z-Order in normal view.
 
Jan said:
Hi Dirk,
I'm sorry. I didn't explain very well. The form is in form view and
involves several controls that I overlap and I want to bring them to
the front when a certain control has the focus. (I know it doesn't
sound like good design but this is what the client wants).

In a more detailed explanation, when a certain control has the focus,
the corresponding memo field must come to the front for editing etc.
Any thoughts?

Hmm ... If you set the focus to the memo field, it will move to the
front. But I don't think you can move it to the front while still
keeping the focus in some other control. Would Rick Brandt's suggestion
of manipulating its Visible property fulfill your client's requirements?
Or could you do something with a tab control?
 
Dirk and Rick,
Thanks for the advice. I have tried both options and the one best suited
for the form is Rick's. I'll have to work with the visible and invisible
property of each control. It's just tedious.

I had hoped that the command to bring a control to the front could be
executed from the focus of another control in VBA. I looked up the command
and found it: AcCommand ...acCmdBringToFront but can't seem to invoke it
from a control other than the one I want to bring to the front.

Thanks again.
Jan
 
Back
Top