Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-02-12
4
Medium Priority
?
298 Views
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
0
Comment
Question by:stillers1994
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:irudyk
ID: 23621811
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:
Form_FormA.SetFocus
Try using:
DoCmd.OpenForm "FormA"
0
 

Author Comment

by:stillers1994
ID: 23622189
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


0
 
LVL 23

Accepted Solution

by:
irudyk earned 1000 total points
ID: 23622550
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!
0
 

Author Closing Comment

by:stillers1994
ID: 31545994
Many thanks for the quick response
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 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