Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    My application has four major forms that can be opened from a menu bar once Form A is opened after starting the system.

    Form A
    Form B
    Form C
    Form D

    After opening Form A, B, and C, when I open Form D, I get

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    If users do not need to switch from Form C or Form D to Form A or Form B, the easiest way is to open Form C and Form D as dialog forms, i.e. the user can't click outside them. You can do this by setting the Modal and Popup properties of the forms to Yes, or by specifying acDialog as WindowMode when opening them using DoCmd.OpenForm.

    If the users need to be able to switch from Form C or Form D to Form A or Form B, you can test if the other is open using this slightly modified version of a utility function from the Northwind sample database:

    Function IsFormLoaded(ByVal strFormName As String) As Boolean
    ' Returns True if the specified form is open in Form view or Datasheet view.
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) Then
    IsFormLoaded = Forms(strFormName).CurrentView
    End If
    End Function

    For example:

    Function OpenFormC()
    If IsFormLoaded("FormD") = True Then
    DoCmd.Close acForm, "FormD", acSaveNo
    DoCmd.OpenForm "FormC"
    End If
    End Function

    Instead of closing the other form, you could also issue a warning and exit the function/procedure.

    See <post#=306982>post 306982</post#> for a discussion about the cause of the "Cannot open any more databases" error message.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Hans

    That was what I was looking for.

    In my situation 3 open forms are the norm, and normally only one being used for add/edit, other forms being used for lookup, however someone is going to try to open them all. I is nice to quickly click between apps when all forms are open.

    My forms are large with up to 8 subforms each with lots of combo's and linked tables so I can understand rabit breedindg.

    When I run on client's computer (512 mb ram) I get get the message after opening 5 forms.

    On my development computer (1 gb ram ) I get the message after opening 9 forms.

    How does ram relate to jet TableID limit?

    Is there a way to trap the

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    John,

    Frankly, I don't know the answers to your questions.

    The "Cannot open any more databases" error has error number 3048, so you may be able to trap it by putting error handlers in your code (On Error GoTo <label>) but the error doesn't necessarily occur only when running code.

    I don't know of a way to find out how many TableID's are in use.

    I found this in the MS Newsgroups, from Michael Noto (Microsoft Support):
    <hr>This is a limitation of the Jet database engine. The only way I have seen around this is to reduce the number of tableIDs by closing all Recordsets in code, using less complex queries, few combo or list boxes or a reduction in the number of linked tables.<hr>
    So simplifying your design, or allowing only one form to be open at a time may be the only things you can do about it.

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I'm curious why you are getting error message about too many databases. Do you open a recordset in code, directly to the other database (rather than linked tables)?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    If there are a LOT of subforms open and lots of comboboxes, etc., on those subforms on each form, you can certainly get this message. It doesn't require explicitly opening the other database or a recordset on it in code. Access is dealing with connections for each of those rowsources, recordsources, etc.
    Charlotte

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    The reason I asked is that I've dealt with forms that have a lot of subforms and combo boxes, and have not seen this. My understanding was that all the links to the backend were done via a single connection; which is why performance is often helped by keeping open a linked table (such as by using an bound form that is hidden) so that Access doesn't keep having to make a new connection. Of course, there has often been somewhat of a gap between my understanding and reality!
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Mark

    I'm using linked tables.

    What I don't understand is why haveing more ram allows more open forms before getting the message as explained in post 313072

    John

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Hans

    If I open Form A, then without closing Form A , open Form B, then click on Form A Task Bar, is there any way to activate Form A Private Sub Form_Current() event?

    Thanks, John

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Try Private Sub Form_Activate()

  11. #11
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    John,

    I can't duplicate this problem, and if it was just a matter of memory I would think I should able to. On my laptop which only has 80MB of RAM, I opened these forms:
    #1 has 15+ subforms and god knows how many combo boxes
    #2 has 36 combo/list boxes
    #3 has about 19 subforms
    #4 has about 5 subforms and a slew of combo/list boxes
    #5 has at least 10 subforms.

    I've got to believe there is something else going on with your application.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  12. #12
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Best Way To Manage Open Forms? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Mark

    Thanks for your help. I'm sure this message will show up on the forum again.

    John

Posting Permissions

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