Results 1 to 6 of 6
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    Outlook Opens behind form

    Hi All

    I have a small problem that i can't seem to figure out.

    i have a form that opens Maximized that has a button on , that when clicked opens outlook with the required e-mail address inserted.

    the problem i have is that outlook opens behind the maximized form, to see outlook my users have to press alt & tab,



    how can i get outlook to open up always on top of the access?

    any pointers would be great

    Many thanks

    Steve

  2. #2
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    1) Check whether the form is set to be "Modal".

    2) Here's a page on how to use VBA to bring an external application window to the foreground.
    http://www.everythingaccess.com/tuto...the-foreground

    3) You might be able to acheive the same thing in a simpler way by having the Access application minimize itself instead, if that would meet your needs.

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Dal

    thanks for the link, not sure where i would put this code? is it in a module or on the buttons on-click action?

    outlook opens a window called "Untitled-message(HTML)"

    in just really starting with VBA and this is abit daunting to get my head around

    i have checked the form, its set as
    Pop up = yes
    modal = no

    Border style = thin

    form has on open event that sets it maximized "DoCmd.Maximize"

    Steve

  4. #4
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Yeah, that code is not pretty. It's VBA, but it doesn't look like Access VBA to me. It would go in a separate module, and when you got it working you'd call the public function FnSetForegroundWindow(strWindowTitle As String) to find and bring to the foreground the window you were looking for.

    UGLY ALTERNATIVE 1:

    This line of code will drop access out from in front of Outlook, but there has to be a more elegant solution than making the person re-maximize Access after every email.
    Code:
    DoCmd.RunCommand acCmdAppMinimize
    UGLY ALTERNATIVE 2:

    Worst case scenario, you can use SendKeys to send Access the alt-tab command. (Ducks head to avoid incoming objects).
    http://msdn.microsoft.com/en-us/libr.../ff192656.aspx for the macro action or
    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx for the VBA method.

    Sendkeys is considered very squirrelly.

    OTHER POSSIBLE ALTERNATIVES:

    Here's some other possible ways: http://www.utteraccess.com/forum/Ope...-t1922737.html

    QUESTIONS:

    What is the actual code that you're using to open Outlook in the first place? Is there a line that looks like
    Code:
    (something).Display
    in it somewhere?

    By the way, you should be able to set the message title to something else.

  5. #5
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    hi Dal

    well i have this working now, i changed the form from being opened "maximized" to a popup thats the same size as the screen, this way the toolbar is visible and outlook now opens as it should.

    this gives me the same result, I should have done this to start with lol, as i would have saved afew hours trying to resolve this issue

    anyway thanks for the reply

    many thanks

    Steve

  6. #6
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Any port in a storm. Good job finding a solution that will work for your user!

    Please mark the thread "solved". Top of page, under "thread tools".

Please reply to this thread with any new information or opinions.

Similar Threads

  1. email address field opens in Outlook?
    By pbouk in forum Forms
    Replies: 1
    Last Post: 06-04-2013, 03:29 PM
  2. button that opens form
    By rwest in forum Forms
    Replies: 3
    Last Post: 01-06-2012, 11:59 AM
  3. Replies: 35
    Last Post: 12-21-2011, 02:16 PM
  4. Replies: 1
    Last Post: 03-07-2011, 10:48 AM
  5. Form opens for only seconds
    By MFS in forum Programming
    Replies: 5
    Last Post: 11-04-2010, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums