Full Version: Don't Allow Operations Until All Records Loaded
UtterAccess Forums > Microsoft® Access > Access Forms
've got a database with about 6000 records in the table I'm trying to access. My problem is that when the form loads the information it loads quite slowly. So for a while it says "Record: (arrow) (arrow) 1 of ____)" at the bottom of the screen. If the user tries to punch information into the search bar before it loads and says "Record: (arrow) (arrow) 1 of 6000)" it goes very slowly and freezes half the time.
Is there a way to lock the search bar and all form operations until all of the records are loaded?
Well, one way to force suspension of UI is to invoke Me.Recordset.Movelast on the form's load which will wait until it's all loaded.
owever! Wouldn't it be much better to instead show your users a search form to select a subset of the records and load only that subset instead of whole 6000 every single time?
Also you can use OnTime event. Enable form after for example 10 seconds. (never tested, just hope it is possible)
Myb this DB can help you.
I wouldn't use Timer since there's no correlation to whether all records has been loaded or not; doing a .MoveLast will block operations until all records are loaded and thus no need for timing or anything like that. There's also other issues with Timer that I tend to think it's best avoided. In fact, I probably can count on one hand where I really had to use Timer events.
Since BR got way better experience than me, I must agree with him.
I'll try the movelast technique! Thanks!
But why not just not load 6000 and have your users filter? That will be better for everyone involved.
I'm with BR here. Why load 6,000 records at once in the first place?
While there are multiple ways to address this, the basic principle we want to honor "Load the least number of records possible at a time." At least that's how I look at it. I want to load each form with no more than one record at a time, if that is apllicable, and initially, with no records at all if that is possible.
To make that effective, you need to have a control on your form through which you can select a single record at a time, e.g. a combo box. To speed up the load of the combo box itself (since it will need to be able to display all of the 6,000 possible records), you can apply a prefiltering technique, such as the one demoed here.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.