none
Changing startup Page RRS feed

  • Question

  • if my Database opens with [Form1] and it has a checkbox [ckbStart], if ckbStart is true then close [Form1] and open [Form2]

    Thanks for any help.............Bob


    xxx

    Monday, June 13, 2016 11:00 PM

All replies

  • If Me.CheckBoxName = True Then

       DoCmd.Close

       DoCmd.OpenForm "Form2"

    End If


    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Tuesday, June 14, 2016 12:13 AM
  • If Me.CheckBoxName = True Then

       DoCmd.Close

       DoCmd.OpenForm "Form2"

    End If


    Hi Bob and Daniel,

    I would rather this turnaround:

    If (Me.CheckBoxName = True) Then
       DoCmd.OpenForm "Form2"
       DoCmd.Close acForm, Me.Name
    End If
    

    Imb.

    Tuesday, June 14, 2016 5:54 AM
  • Either way, both should work fine.

    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Tuesday, June 14, 2016 12:23 PM
  • Thanks Guys I am getting the error cannot open anymore databases

    Should it be in my Main page On  Load or On Open ...Thanks Bob


    xxx

    Wednesday, June 15, 2016 12:22 AM
  • Just noticed I have a Macro to load my startup page, should I be using this or my Display page in Options???

    Thanks Bob


    xxx

    Wednesday, June 15, 2016 12:53 AM
  • Hi Bob,

    I think these code would work in Form_Load event. Did it work for you?

    >> Just noticed I have a Macro to load my startup page, should I be using this or my Display page in Options???

    When did you run this code? For a startup Form, I think you could File->Option->Current Database->Display Form, and set it with your main form, then add above code in the Form_Load event of main Form.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 15, 2016 6:59 AM
  • Thanks Edward , Deleted the Macro and used the display page to open frmMain

    Entered either one of these codes in , Open, load, and current but am getting this error

    Thanks Bob


    xxx

    Wednesday, June 15, 2016 11:00 PM
  • This usually occurs when you have very complex forms/reports that create too many connections, and thus you hit the limit.

    Things like subforms, listboxes, combo boxes, calls to functions like DLookUp(), ... all take up connections.Is this the case, you are working with complex form?

    Any chance you can provide us with a copy of the db to review ourselves?

    Have you seen: https://social.msdn.microsoft.com/Forums/office/en-US/9993d229-8a00-4a59-a796-dfa2dad505bc/cannot-open-any-more-databases?forum=accessdev it may shed some light.


    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Thursday, June 16, 2016 12:21 AM
  • Thanks Daniel, is their is a lot to load up on my Main Menu page, I think I will have to make another complete database and use it for a Laptop as the original database is to big for a laptop screen. My database is very sensitive and would like it to get out in the public arena. Actually that wont work because each form is coded back to my frm Main...............Regards Bob

    xxx

    Thursday, June 16, 2016 1:00 AM
  • Hi Bob,

    I assume there is something wrong in your Main Menu page. I suggest you follow below steps:

    1. Delete the startup macro and cancel setting startup form
    2. Open frmMain manually to check whether you will get any error
    3. Check the related event like Form_Load event
    4. Comment out the code part by part to check which line cause this error

    It would be helpful if you could share us the related code which causes this issue.

    Best Regards,

    Edward

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, June 16, 2016 5:31 AM