Access popup forms not always open on first screen, sometimes yes and sometimes not (1 Viewer)

eprous

New member
Local time
Today, 03:31
Joined
Jul 20, 2022
Messages
5
Hello
Working with version 2206 of Access 365 MSO, in client server format with a SQLServer database, I am having problems displaying forms in the foreground.
I have several forms, in general showing a lot of information that I download from SQLServer.
They are PopUp forms, Modal = No but in many cases they are opened with 'acDialog' format.
The problem is that if the loading time is high (due to the amount of data, download time from the server or calculations prior to displaying the data), a flick occurs on the screen and the form does not open on the first page. Because the forms has been. opened with 'acDialog' and it behaves like modal, it is not possible to minimize the source form and the only solution I have found so far is to open another application (excell, word) and close it. Doint that the form is already visible on the first page. It happens to me with many similar forms and it doesn't always happen, I think it's a timing problem, but so far I haven't found a solution. Any suggestions? Thanks
 

isladogs

MVP / VIP
Local time
Today, 02:31
Joined
Jan 14, 2017
Messages
18,164
In general, you should avoid loading all data into a form at startup precisely for the reasons you state -slow loading time etc.
Much better to load the form with minimal / no data and allow users to choose which data they want to see.

It also seems that you are trying to load several forms at once. Once again, much better to avoid doing that as well.

Also, do you really need to use acDialog (or Modal). Test what happens if you use Popup only.
 

eprous

New member
Local time
Today, 03:31
Joined
Jul 20, 2022
Messages
5
Thank you.

I am trying to load only one for at once, it is true that the number of common data to show and the pre-calculations are too many in some case.
I have tried to popup the form empty and add a TimerInterval of some ms to start then the real load of information . The situation has improved, but still some times the form is 'hidden' again behing other forms.

The question is why just opening and clossing other application the forms popups as expected.

Is there any way to force a form to go to the first page whe the load finish ?
 

strive4peace

AWF VIP
Local time
Yesterday, 21:31
Joined
Apr 3, 2020
Messages
1,003
hi @eprous

> "Is there any way to force a form to go to the first page whe the load finish"

you can use DoCmd but I prefer not to do it with macro commands, Instead, I like this:

Code:
me.Recordset.MoveFirst

"me" can be another form reference ~
 

eprous

New member
Local time
Today, 03:31
Joined
Jul 20, 2022
Messages
5
Thank you.
>me.Recordset.MoveFirst
I am afraid this will not solve my problem. I am talking about forms without recordset.
Your suggestioin moves the cursor to the first record in the recordset.
What I need is to move the active form to the "frontpage" in the screen.
BR.
 

strive4peace

AWF VIP
Local time
Yesterday, 21:31
Joined
Apr 3, 2020
Messages
1,003
@eprous, ah, what you want to do then is set the focus to your first control in the form Load event:

Code:
me.controlname.SetFocus
 

eprous

New member
Local time
Today, 03:31
Joined
Jul 20, 2022
Messages
5
Yes, this was one of my first ideas, but... if the load takes time... it is not enough. Honestly, I am really confused. Thank you
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:31
Joined
Feb 19, 2002
Messages
42,872
I have several forms, in general showing a lot of information that I download from SQLServer.
Main forms should NOT be bound directly to tables or even to queries with no WHERE clause. The only way to get SQL Server to do the heavy lifting, is to severely limit the data retrieved by bound forms.

An easy way to do that is to have a search field or maybe a combo to select a single record. Then the RecordSource query will be:

Select ...
From ...
Where RecID = Forms!yourform!txtRecID

When the form opens, txtRecID will be empty so no record will be loaded. Then the user picks a value and your code requeries the form to populate it. It may seem like extra work but what is the likelihood that the form will open to the record the user wants to work with? Slim to none is the usual answer. So, you may as well make it a two step operation all the time.
 

Users who are viewing this thread

Top Bottom