Access 2007 tabbed document format. How do I bring an already open form to front

I am using Access 2007 tabbed document format.
I open 2 forms using a macro at startup shall we say, FormA & FormB and as Form B opens last it then has the focus and is 'on top' of screen.
The forms are split forms based on different but linked data. They remain on the screen at all times and I can access each by clicking on the appropriate tab
What I would like to do is click on a button on FormB to bring FormA to the front, positioned at a particular.
I have tried using FormA.SetFocus in the onClick event of FormB's button but this doesn't bring FormA to the front
What am I missing here?
Both forms are opened at first by running a macro, they are both non-modal, non-dialog and so have no reason to hold precedence but I just can't seem to get the other form to come to the fore.
I am comfortable(ish) with vba so please feel free...
Any help as ever, gratefully received
Who is Participating?
irudykConnect With a Mentor Commented:
I'm glad it worked out for you.  Yeah, it is a shame that it doesn't, but if you wanted to do something when FromA got the focus (i.e. when you previously tried to use the .SetFocus), you would have had to use some kind of work-around code anyway (i.e. since the SetFocus has no OpenArgs functionality). So, although it would have been nice to save some coding, you are really no worse off than you would previously been.  Good luck with it!
When the form are in a tabbed document format, I've found that using code to open the form will get the focus to change.
So, instead of using VBA code like:
Try using:
DoCmd.OpenForm "FormA"
stillers1994Author Commented:
Well that was very easy, thankyou very much
- Just a shame that the openargs thing doesn't seem to work with the OpenForm call then I could neatly position to the required record

stillers1994Author Commented:
Many thanks for the quick response
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.