Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sendkeys to another Access App (2000)

    Is it possible to send keystrokes to another Access application? I want to compress the application in question but the only way to close it is to enter a keystroke combination (Alt-W) which was chosen so that it would be unlikely that anybody closed it by accident.

    Ian

  2. #2
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sendkeys to another Access App (2000)

    Hmmm, can't you use DoCmd.Quit?

    What I would recommend would be to use the GetObject function. You can use the path to the database, with that statement. That gives you an Automation copy of the object. You can then close it. If you have a form that is open in the background, to prevent someone from closing it with the X, then just close that form from code...sample:

    Dim Acc
    set Acc=createobject("C:MyDatabase.mdb")
    Acc.DoCmd.Close acForm,"MyPreventCloseForm"
    Acc.DoCmd.Quit
    Set Acc=nothing

    Hope that helps.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sendkeys to another Access App (2000)

    Is there a reason for opening the other application in the first place? You can compact from code without actually opening the other database if you use the DBEngine.CompactDatabase method.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •