Performace - multiple forms opened

medihub_guy

Member
Local time
Today, 18:42
Joined
Aug 12, 2023
Messages
63
Good day all,

How much of an impact on performance does opening multiple forms at once have on database application performance?

Lets say 3 to 5 forms as opposed to 1 to 2 forms.
 

ebs17

Well-known member
Local time
Tomorrow, 00:42
Joined
Feb 7, 2020
Messages
1,946
More work takes more time.

But this work is not only reflected in the number of forms. Special effort can generate
- the loading of queries
- loading graphics files
- conditional formatting
- complex calculations

There can be several queries in a form, as data source also for sub-forms, combo boxes, list boxes, in DLookup & Co., and queries can be simple or complex, use a few records or millions of records.
 

medihub_guy

Member
Local time
Today, 18:42
Joined
Aug 12, 2023
Messages
63
So regardless if the form is already loaded, there still will be memory required to keep the form open?
My question is: would the performance take a noticeable hit the more forms are opened? Should I now write code to close forms once I move on to the next form in sequence? Is this ideal/recommended?
 

ebs17

Well-known member
Local time
Tomorrow, 00:42
Joined
Feb 7, 2020
Messages
1,946
would the performance take a noticeable hit the more forms are opened?
It depends.
In databases, you potentially have to deal with a lot of data. If these exceed the memory space provided for Access, a switch takes place between the main memory and the swap file. The time for more complex I/O actions would therefore be added to load information.
Should I now write code to close forms once I move on to the next form in sequence?
This often makes sense and is preferred. But here, too, it depends on specific cases.
 

medihub_guy

Member
Local time
Today, 18:42
Joined
Aug 12, 2023
Messages
63
Ok great! Ill limit the amount of forms opened and add close commands once new form is opened. Thank you so much for the concise answer!
 

MsAccessNL

Member
Local time
Tomorrow, 00:42
Joined
Aug 27, 2022
Messages
184
Members2.PNG
 

MsAccessNL

Member
Local time
Tomorrow, 00:42
Joined
Aug 27, 2022
Messages
184
I mostly use a menu at the side or the on the top. The menu wil open the form inside a subform control called FormContainer1. You can set the sourceobject: FormContainer1.SourceObject = "FormName". In this way you never have a lot forms open at the sametime. When i use more forms then I add FormContainer2 and let this slide open like on a webpage.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:42
Joined
Feb 19, 2002
Messages
43,293
So regardless if the form is already loaded, there still will be memory required to keep the form open?
Yes. As long as an object is open, it occupies space in memory.

Unless there is some specific reason that the user needs to see data from multiple forms at the same time, they tend to be confused by having multiple forms open, especially if they can open second instances of any given form. When I have a process that goes from form to form, I hide the first form before opening the second form so the user only sees one form. When the user closes the second form, the first form becomes visible again positioned on the same record it was on when the second form was opened. Since some forms can be opened by more than one other form, I use the open args to pass in the name of the opening form. That way when the second form closes, it knows which form opened it and so it knows which form to open. The "open" of a hidden form simply makes the hidden form visible again. It does not reload it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:42
Joined
Feb 28, 2001
Messages
27,189
You use up memory by having multiple forms open, but if none of them have active timers, and if all of the forms are single-record (vs. continuous), the ONLY load is a little bit of memory for the form's internal structure and for the form's .Recordset structure. A stationary form takes up a trickle of CPU time every 30 seconds (tunable from the File >> Options >> Current Database path to deal with the auto-refresh function.) Forms represent a computational load only when you navigate or perform a specific record action such as save or delete, or if someone re-positions, stretches, or shrinks the form. If you are doing nothing, the form is doing nothing.
 

isladogs

MVP / VIP
Local time
Today, 23:42
Joined
Jan 14, 2017
Messages
18,235
Be that as it may, having multiple forms open is using up available connections even if the forms are doing nothing!
Eventually with many forms or other objects open at once, performance will be affected before finally the database may crash with a 'cannot open any more databases' error
Recent change in A365 make that less likely but I'd still advise against having lots of forms open at once both to avoid confusing end users and to avoid performance issues
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:42
Joined
Feb 28, 2001
Messages
27,189
Colin, I don't disagree that opening multiple forms holds connections open. Resource consumtion is what you often encounter.
 

Edgar_

Active member
Local time
Today, 17:42
Joined
Jul 8, 2023
Messages
431
How much of an impact on performance does opening multiple forms at once have on database application performance?

Lets say 3 to 5 forms as opposed to 1 to 2 forms.
It's not the quantity of open forms that matters, but rather the content each form contains. It's possible for a single form to consume more memory than multiple forms opened simultaneously, regardless of the number of forms involved.

Ill limit the amount of forms opened and add close commands once new form is opened.
The navigation control accomplishes this task.
 

isladogs

MVP / VIP
Local time
Today, 23:42
Joined
Jan 14, 2017
Messages
18,235
Connections being used by open forms and other objects ARE consuming resources and only a finite number of connections can be opened at once.

Whilst it is true that certain forms will consume more, typically each open form will use at least four connections. Multiple sub forms will increase that number. Similarly the use of sub data sheets.

Navigation type forms are an efficient use of resources as only one subform can ever be open at the same time.
 

Edgar_

Active member
Local time
Today, 17:42
Joined
Jul 8, 2023
Messages
431
If the context of this post aligns with the previous ones by the original poster, where he talked about wanting to launch a piece of software, my top advice would be for the OP to explore articles about 'minimum viable products'. There might be aspects he's already got sorted and functioning well, but we're all suggesting changes left and right. In reality, the OP might not know whether the product will succeed or not, so drastic changes and efforts towards optimization might be a bad move until there's certainty in the sales.

Talking about the main point, having 1 or 2 form instances beats having 3 or 5, no question. So, rather than making the instancing process slick, the real deal is finding ways to dodge opening lots of instances in the first place, so that design should change.
 

ebs17

Well-known member
Local time
Tomorrow, 00:42
Joined
Feb 7, 2020
Messages
1,946
Broad discussion.

The key word in the topic title and contribution was performance. Do you also measure your contributions by this?
 

Edgar_

Active member
Local time
Today, 17:42
Joined
Jul 8, 2023
Messages
431
Being the previous poster, ebs, are you referring to me? if so, what do you mean?
 

ebs17

Well-known member
Local time
Tomorrow, 00:42
Joined
Feb 7, 2020
Messages
1,946
Counter-question: What in your own contribution actually affects the performance within the application when working with forms?

When forms are simply open, they consume resources, but there is no performance consumption.
Performance is an issue when something moves, something is recalculated, something is reloaded. This is where resources come into play, namely when additional resources are required and come into conflict with resources that have been provided and are already being used.
 

Edgar_

Active member
Local time
Today, 17:42
Joined
Jul 8, 2023
Messages
431
Not sure if that was aimed at me but performance depends on resource management, that includes human resources, not just machine resources, engineering a design that takes good care of that impacts on the ability to produce satisfactory results and user experience. Multiple forms mean having to take care of each instance when you could have just one instance showing all the records you actually need. Instances require:
Extra resources
Extra clicks
Extra positioning and space
Moving focus from one place to another
Not to mention dealing with the collection of forms
Etc

Too much trouble and poor user experience.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:42
Joined
Feb 28, 2001
Messages
27,189
In the past I have had occasions when my users opened more than one form at a time. This arose from a design in which each form showed purity of purpose (for the most part.) That is, if you opened the Computers form you were updating information about the computers on our site. If you opened the Projects form you were updating project information, and so on. I had Users, Computers, Projects, Teams, Tasks, and a few other items having to do with workflow and accountability issues.

The question is, what happens in the workflow to cause people to WANT/NEED to open multiple forms at once? When the concern is that someone wants to open multiple forms, what drives that approach? Are they overloaded and trying to do too much at once due to unrealistic expectation or is the workflow complex enough that you need to open multiple forms to get something through your work process? The question of performance should be backed out in scope to include the human factors relating to performance. What drives people to appear to want to do multiple things at once?

But it goes further than that. Every time you try to do multiple things at a time through having multiple forms open, you run into the problem that each form has its own context, which is normally independent of everything else. The USERS have that many MENTAL contexts, one for each form that is open, so they have to shift attention from one to the next.

So... let's say (using my old project as the basis) that you wanted to update membership of a project team, so you use the Teams form. Voila, person added! But now you have a task you want to assign to that person because he is now a member of the team. So you go to the Tasks form, WHICH WAS ALREADY OPEN. For the next 30 seconds or so, you might be unable make the assignment because the form's context had already looked up team members eligible for the action and the auto-refresh is 30 seconds. You want to assign the user but the combo-box of eligible users has ALREADY QUERIED the list of team members. You need to refresh the form that was already open to force it to recognize the new member.

Granted, my case is hypothetical because I had actually solved that problem in other ways, but the point is that EVERY OPEN FORM has its own context that was updated at the most recent navigation event. Having too many forms open at once runs the risk of destructive self-interference (a.k.a. "the left hand doesn't know what the right hand is doing.") So to the extent that there may be an OPERATIONAL-level issue, WHY do you need 3-5 forms open at once? Would a form change to incorporate a different viewpoint reduce the NEED for that many forms being active?

All too often we focus on machine factors in performance, but we have to remember that Access forms, being human-interactive, also depend on "think time" as a link in the performance chain. The question about performance has been answered in various ways. Open, idle forms incur no CPU load but will incur memory load and back-stage resource loads. But what about the people using this scenario?
 

Users who are viewing this thread

Top Bottom