Results 1 to 7 of 7
  1. #1
    dntakoulas is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    4

    Execute form On Open trigger without showing the form

    Hi all,

    I have recently taken over an MS Access application and need to use some existing functionality.

    Form 'A' has a On Open event and when a user opens the form.


    I am creating an module to automate some things and need this form's On Open event to run for the given input Filter and Arguments, BUT I need the user to be unaware of the whole process.

    So my question is: Is there a way to open a form and letting On Open the event execute without actually showing the form?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    take a look at the OpenForm method of the DoCmd object:
    https://msdn.microsoft.com/en-us/lib.../ff820845.aspx
    the key parameter you want is 'view'
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    dntakoulas is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    4
    Hi Micron,

    Thank you for your quick reply.
    I have seen this document, but from what it says I understand that no matter which value you use, the form will show up.
    What I need is the form to execute its code while remain invisible

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Sorry, I should have followed the links on that page to be sure. The parameter you want is WindowMode and the property is acHidden.
    It will work as you desire.

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Is this what you mean?


    Code:
    DoCmd.OpenForm "Form1", acNormal, , , , acHidden
    do lots of stuff whilst form invisible
    Code:
    DoCmd.OpenForm "Form1", acNormal
    makes form visible again

  6. #6
    dntakoulas is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    4
    Thank you Micron, I will try it tomorrow and let you know if it worked

  7. #7
    dntakoulas is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2017
    Posts
    4
    Hi guys,

    Thanks you all for the help, I followed Microns advice and I made it work
    Thanks again!

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

Similar Threads

  1. Replies: 8
    Last Post: 12-01-2014, 09:48 AM
  2. Form keeps showing up blank on open
    By rthakral in forum Forms
    Replies: 3
    Last Post: 09-24-2013, 01:35 PM
  3. Replies: 4
    Last Post: 12-14-2012, 03:42 PM
  4. Replies: 0
    Last Post: 03-07-2011, 04:30 PM
  5. Replies: 0
    Last Post: 03-11-2010, 02:11 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