Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting subform to front or back

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
0
0
GB
Hi there

I have a MainForm with two subforms, left and right.
Unfortunately I have to much information to display on each (which are identical) so I need to set with VBA each subform to be sent to the front and/or back depending on which subform has the focus.

So if the right subform has the focus, the left hand side subform must be sent to rear and viceversa.

This is so the full subform can be seen when it has the focus.

I would appreciate if anyone could advise how to do this on the 'onfocus' or any other way...

thanks

 
What about putting the subforms on a tab control instead? I've run into some weird issues with Access every now and then messing with the order of objects on a form - (during one conversion from 2000 to 2003, several form objects that were set to be on top moved to the background!!).

The tab control solves the "real estate" problem plus minimizes the potential for error.

Cindy K.
 
Thanks for your input

I cannot use the TAB CONTROL because I must be able to see both forms at once...even if one of them I can only see 80%, the fields which I do see are important.
I have to be able to check the left subform with the right subform at the same time.

Any other ideas ?
 
I see. Don't you hate it when someone sends an "answer" that doesn't work and then you wonder if people will come back and read your original question??

It sounds like you've decided there IS enough form room to show at least a portion of both forms -

I don't think it's possible to change the size of subforms dynamically - but maybe it makes sense to ditch the concept of a subform and do pop up forms instead - where the user can position them as they want on the screen? If you make them sizeable - it might be the best of both worlds - because those users who have the large screens (or dual monitors) can view all they want, whereas the others can do resizing to fit their monitors/needs?? Both forms can be tied to the record on the "main form" - maybe with a recordsource requery if someone selects a new record on the main form??

Cindy
 
How are ya franksirvent . . .

There's a drfinite [purple]ambuguity[/purple] here!
franksirvent said:
[blue]I have a MainForm with two subforms, [purple]left and right[/purple]
Unfortunately I have to much information to display on each (which are identical) so [purple]I need to set with VBA each subform to be sent to the front and/or back [/purple]depending on which subform has the focus.[/blue]
franksirvent said:
[blue]I cannot use the TAB CONTROL because [purple]I must be able to see both forms at once...[/purple][/blue]
[blue]Can you see it? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi Cindy
thanks for your input.
I have thought about resizeable pops but, at the moment, I would like to see if there is a way of doing it via VBA instead for a number of reasons (I don't want people having to resize the subforms, etc etc)

AceMan, I am not sure what you are trying to say but perhaps I didn't explain myself properly
What I mean is that I have a subformA on the left of the mainform, and subformB on the right of the mainform.
Unfortunately both together are about 2 cms wider than the Main Form width, therefore they overlap in the middle, and 1cms approx of one of the subforms is behind the other subform. The rest of the subform which is on the back is visible.
What I need is, for example, if SubformB (the one on the back) gets the focus, then it is automatically brought to the front (or SubformA is brought to the back, as you prefer) and viceversa.
This way I have 90% of each subform always visible and 100% visible the subform I am working with (got the focus)
I hope that's clearer..
thanks
 
Have you tried to play with this ?
DoCmd.RunCommand acCmdBringToFront

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
franksirvent . . .

There are two commands . . .
Code:
[blue]   DoCmd.RunCommand acCmdBringToFront
   DoCmd.RunCommand acCmdSendToBack[/blue]
. . . [purple]but they only work in design view[/purple] [thumbsdown]

Perhaps you can put one under the other?
or
Maybe code can find what you looking for? (explain)

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top