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

Posted on 2009-02-12
Last Modified: 2013-11-18
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
Question by:stillers1994
    LVL 23

    Expert Comment

    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"

    Author Comment

    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

    LVL 23

    Accepted Solution

    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!

    Author Closing Comment

    Many thanks for the quick response

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    This article will show, step by step, how to integrate R code into a R Sweave document
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now