Results 1 to 11 of 11
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Opening multiply Forms?

    I know that under Options you can designate a Form to open up when the database is first opened. However, does Access only limits this to 1-Form or is there a way I can configure a database to open with 2 or 3-Forms when opening a database? If so, please explain in detail how.


    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You can have code to open multiple forms. Just have another line for DoCmd.OpenForm.

    However, if the DoCmd.OpenForm includes acDialog argument then the additional forms won't open until the first form closes because acDialog suspends code execution until the form closes. Also, the Modal property set to Yes won't allow form focus to change.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    June, thanks for replying. When you say, "Just have another line for DoCmd.OpenForm." Where?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Like:

    DoCmd.OpenForm "formA"
    DoCmd.OpenForm "formB"
    DoCmd.OpenForm "formC"


    Unless you are talking about multiple instances of the same form object. That is an entirely different issue. http://allenbrowne.com/ser-35.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    yea, but June I don't know where to put the codes in. Right now I have a dbs that opens a form, where might I go to find that code?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Okay, just reread your original post. Put code to open additional forms behind the form that is set to open by project default. Could be in that form's Open, Load, or Current event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Another approach would be to

    • Create a Macro
    • Enter Commands in it to Open all of the wanted Forms
    • Give the Macro the name AutoExec

    This is a special Macro that always executes when an Access Database first opens.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Quote Originally Posted by Missinglinq View Post
    Another approach would be to

    • Create a Macro
    • Enter Commands in it to Open all of the wanted Forms
    • Give the Macro the name AutoExec

    This is a special Macro that always executes when an Access Database first opens.

    Linq ;0)>

    Questiong ; Creating this Macro named AutoExec, would this over rule the form the user already set under options? Meaning would that setting still apply, or would the autoexec macro ignore that?

  9. #9
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Never tried this, but have no reason to think that one would interfere with the other. I wouldn't do both, for this; what would be the point? If I had multiple Forms I wanted to open, on opening the app, I'd use AutoExec.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  10. #10
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Thanks to all for your input. Under total expectations of coming up with nothing on a whim I tried creating a macro and... it actually worked! I now have 2-Forms open upon opening one of my databases. Thanks again! :-)

  11. #11
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    It should be noted that you can use the AutoExec Macro to do basically anything that can be done with a Macro and that needs to be done when a Database initially opens.

    This can include things like setting Global Variables/TempVars or popping up reminder messages, based on whatever; time of year, quarter of the fiscal year, day of the week, day of the month, whatever.

    AutoExec stands for Auto-Execute, and is a carry-over from the old DOS/pre-Windows days. There used to be an AutoExec.Bat file that ran when the system was booting up, with instructions on how to do a number of things in configuring the system.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Two forms opening the same form
    By MikeMairangi in forum Forms
    Replies: 5
    Last Post: 08-31-2011, 01:55 PM
  2. opening forms extra records
    By Lupson2011 in forum Access
    Replies: 2
    Last Post: 08-31-2011, 10:26 AM
  3. Opening Forms Multiple Arguements
    By Lupson2011 in forum Access
    Replies: 10
    Last Post: 08-30-2011, 08:51 AM
  4. Forms opening on new record entry
    By daddylongtoe in forum Forms
    Replies: 4
    Last Post: 06-28-2010, 04:15 AM
  5. Access freezes when opening forms
    By thorpef1 in forum Access
    Replies: 0
    Last Post: 01-04-2010, 04:48 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