Results 1 to 3 of 3
  1. #1
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18

    Control of Access Instance from Outlook - AppActivate

    This query is more related to Outlook, but I can't seem to get help in other forums...





    I've got some Outlook code, which grabs the open Access.Application object.
    It run's some code in the Access application, which works well!
    But i'm having problems setting the focus / activating the Access window.

    AppActivate works great in other Office applications, but does NOT seem to exist in Outlook?
    Code:
    Dim appAccess As Access.Application
        Set appAccess = GetObject(, "Access.Application")
        appAccess.Run "openjobdetailsform", GetJobID(strJobNumber)
    
       'Set the focus somehow!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    It might have something to do with this
    appAccess.Run "openjobdetailsform", GetJobID(strJobNumber)

    You may be tying up the application with whatever that is; i.e. code needs to wait. What is that?

    FYI - it's common courtesy to post links to all forums where you have posted your problem. It allows us to review any answers you got there so that we're not making the same suggestions. It's good that you declared you have posted elsewhere, so that's a start!

    EDIT - also thinking that if setting the Visible property of the open database doesn't work, try using the SetFocus API. I don't have an example of it, but you should be able to find code for it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18
    Thanks for the quick reply.

    Code is running fine! I just want the Access window to be activated / focus set.
    SetFocus API is a good idea.
    I've just realised I could run AppActivate from inside the openjobdetailsform() procedure instead ������


    Here's my other post...
    https://www.msofficeforums.com/outlo...tml#post147233

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

Similar Threads

  1. disable visual update duting control of outlook
    By MTD072 in forum Programming
    Replies: 4
    Last Post: 10-09-2017, 12:05 AM
  2. Replies: 2
    Last Post: 07-14-2015, 11:39 AM
  3. Amount of control of outlook
    By Ruegen in forum Access
    Replies: 6
    Last Post: 12-04-2014, 07:57 PM
  4. Replies: 5
    Last Post: 10-11-2013, 07:29 AM
  5. AppActivate
    By RHall in forum Programming
    Replies: 1
    Last Post: 04-10-2006, 11:45 AM

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