1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: how to open form without open access window

Discussion in 'Business Applications' started by Jayabhadra, Feb 13, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    You open the VBA editor (Alt + f11) and on the Menu Insert>Module which is basically the same as an event procedure but it cna be "called" from anywhere in the database.
     
  2. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    I'm trying to make the module in the last file you posted. Is this correct:
    Option Compare Database
    Public Sub AutoExec()
    fAccessWindow ("Minimize", False, False)
    End Sub

    By the way, how to turn the file back to normal? Because it even dont have any "save as" option..

    Thanks :)
     
  3. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    You use
    fAccessWindow ("Show", False, False)
    to set it back to normal.
     
  4. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    Is this the right content of the module:
    Option Compare Database
    Public Sub AutoExec()
    fAccessWindow ("Minimize", False, False)
    End Sub

    Cause it says syntax error..

    I mean to turn the file you posted back to normal, how did you do it?
     
  5. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Sorry there is more to it than that. I will test it and get back to you.
     
  6. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Ok, I had the order mixed up, you need 2 macros, one to turn off the window and one to turn it back on.
    They use 2 extensive VBA Functions in one module called Module1.
    So I have created a form called Form1 in pop up mode. In the OnOpen event I have used the Macro Hide and in the OnClose event I have used the Show macro.
    Opne the form and Access disappears, close it and Access re-appears.
     

    Attached Files:

  7. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    perfect OBP, this is just what I need. Now there's just this three question I have for this issue:
    1. I get this type of thing every time I open office file with macro in it (see attachment), so I need to click the Option>Enable Macro. Is there anything I can do to make the macro run automatically every time I open the file?
    2. To make everything close when I click "Close Form", can I just delete the "show" macro?
    3. If I want my other database to be like that, I need to make exactly the same code in module1 and two macro. Is this right? Or I just need to create the two macro without module1?

    So many thanks!!
     
  8. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    Sorry forget to attach
     

    Attached Files:

  9. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
  10. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    Is the VBA in Form module necessary to be copied too?
     
  11. Jayabhadra

    Jayabhadra Thread Starter

    Joined:
    Feb 13, 2012
    Messages:
    52
    I have erased the "Show" macro. The pop up form window is closed but access window is still open in task bar. How to completely close everything? which part of the code should I delete?
     

    Attached Files:

  12. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1040789