MS Access form is requerying every time I scroll - sql

I have an MS Access continuous form, one of the fields checks the count of files in a folder relevant to the record. These files are stored on a 12.5 Kbps (the speed of a floppy disk) Sharepoint server, so it takes about 7 seconds per record to query the number of files. And that's fine, except that any time I scroll up or down, it requeries the file count of the records that are newly visible on screen. This means I can't scroll past more than one record every 7 seconds.
What I'd like for the form to do is query ALL the records it would show in the continuous form, and then stop requerying them unless specifically told to.
The line for the data source is
WorksheetFileCount: FlrFileCount("\\vaww.visn21.portal.va.gov\sanfrancisco\education\EDADMIN\ProgramFiles\" & [ProgramID] & "\worksheet\") .
What I have tried so far.
Build a separate query for the data and direct the form to that query. Same result.
Build a report from the form. Same result.
EDIT: One particularly weird thing is that it doesn't actually query those folders until that area of the query is visible on screen. So if I put the folder query in the 10th column, and my display only shows 9 columns, it doesn't query the folders until I scroll to the right, at which point it queries all of them. So something in Access is querying JUST the records visible on-screen.

Related

Is there any way to select all or some row of records and then hit a command button that will effect the row of records the same way?

I have a continuous form that contains a varying number of records. Typically it doesn't exceed 100 but it can. Below is the form showing a few row of records. I was wondering if its possible to select a few or all of the records and after selecting them, I click a command button that will run its code accordingly with each record selected.
Continous Form Displaying a few rows of records
The most easy way is to add a check box column to the table. However, in a multi-user environment, this can fall apart. But, the idea is you check off the rows, and then hit a button. That button can process all records with "ToProcess = True" and then when done, it un-sets those records. Since the process would be limited to the one sub form dataset, then this can even work quite well in a multi-user environment, since those sub-forms records are un-likely to be open/viewed at the same time by others.
So, just add a true/false column to the sub form table, and display. The user can check box which rows to operation against. You thus limit the query to the sub form records +

How to disable Automatic Calculation in MS Access

I have a query with 4 calculated fields , one of them calculate the running sum using DSum
When running this query and go to the last record it is taking some time (that is normal and OK)
But the problem is that MS Access recalculate this field every time I scroll up or down using mouse wheel, and this recalculation taking a very long time that make this query unusable
I think MS Access do this recalculation because it is multi user application so I change it to Exclusive (File > Options > Client Settings > Advanced > Default open mode > Exclusive) , but this not help
So Im looking for something like Excel to disable automatic calculation and calculate what you need and when you need using VBA for MS Access or at least prevent MS Access from recalculate the query every time I scroll up or down.
no more than one user will use my database at the same time
the query has about 40,000 records
As Nick wrote, you can't.
To view the data without recalculation, put it into a report, or use a INSERT INTO or SELECT INTO action query to save it to a temporary table. The latter is especially useful, if you want to do further calculations on the data, or if it is the recordsource of another query.

Why filtering in big excel spreadsheet generates huge delay, but using vba solves it faster?

I know this may sound very newbie, but I'd like to know some details about the internal process of Excel filtering.
A few years ago I came across a huge Excel spreadsheet (maybe more than 40 thousand or up to 80 thousand rows) and several columns. When we wanted to filter some data using Excel data filters, the spreadsheet almost collapsed. It took up to 2 or 3 minutes until the desired information would show up, and you shouldn't "bother" it by clicking on the file or you would get the "Not responding" message.
I found a simple code in VBA to actual change the filter's parameters but without actually opening the filters manually (not clicking on them) and the filter would return the filtered data in a matter of 1 second or less.
My question here is, what kind of information does Excel load in memory, so that when you click on a filter -if data is too much- the delay is high?
Because the only thing I did using VBA was actually setting the filter's parameters (i.e. "from the filter called 'City' only return 'Washington', 'Mexico City' and 'Montevideo', etc.)

Access Query not updating fast enough

Im building a key inventory mgmt system. I've created a query that show's me keys currently not in use by identifying which keys have been returned, aren't lost or have never been rented. I copied this query into the look up field for key_id in my keyActivity table (used to record key sign outs). The issue is that the query does not update to provide available keys until the table keyActivity is closed and opened again
Example: I open keyActivity, indicate that key_id = 5 is lost. When I go to a new record and select the key to sign out, key_id = 5 is presented as being available. It is not until I close the table, open it again, that key = 5 is removed from the list.
Here you can see key 5 is indicated as lost in id 5 but in id 7 when selecting a key, 5 is available when it shouldn't be.
Is there anyway to fix this or set this up to work as intended. I plan on using forms to present all the information. Is there a form solution perhaps?
The suggestion you would be better off with a Form to change table data. It can be easily requery-ed to update the table according to the changes you make and to display the udpated data accordingly. Please also read on the given references for further info.
In terms of data updating and locks in a multi user environment this article could be helpful.
"Access is NOT a database server. It's a desktop database. It has been pushed to the limit to support mutli-user environments, but only in the sense that you can share the "back end" database across a network."
...
...
"Even the record locking is performed by the Front End. All of the front end
database applications share the "lock file" (a file with the same name as
the database file, but with the extension LDB); but that file is simply a
mechanism that the front ends use to determine which front end can make
changes to the database."
....
Here is a difference between requery and refresh:
Me.Requery forces the entire recordset (underlying data) for the form to reload. This means ALL of the records in your current form will reload. Your current position will be lost, so if you're sitting on record 10 of 100, you'll find yourself back on the first record. Me.Requery is essentially the same as closing and reopening the form. Any new records added by other concurrent users will be available. Likewise any records that have been deleted will disappear. Requery essentially "re-runs the query" that pulled the data into the form in the first place. You can also use requery to update the data in a list box or combo box.
Me.Refresh saves the current record that you're working on. It will also retrieve any changes (but not additions or deletions) to any records shown in the current form. Any calculations on the form (unbound fields) are recalculated. Refresh does NOT reload the recordset. You do not lose your position in the form (you stay on the current record). Any new records added by other users will not be shown.
Reference
MS Access - Write to Table Immediately After Changing Value in Form

setting up page number for jqgrid

I am facing a problem in setting up the page numbers of jqgrid dynamically. I am new to this jqgrid and would like the assistance to learn it fast.
I have a scenario which if somebody can answer would be very great for me.
I have an application, which can bring millions of records in a single query output.
For this i want something like paging chunks of data instead of getting all data at once (which will not happen anyhow)
For this, i would hit server for first time and find out the total records to be displayed, but return only 2000 of it.
Once user uses paging next button and reaches the last record, on click of next button, the next 2000 records from server will be brought up.
Problem here is the pager shows that there are only 20 pages (i have set 100 as total records in a page), and it disable next button as soon as page 20 is accessed, thus stopping to get new set of data from server
Even if somehow, i get the next set of data, the page should shows me only 20 records of initial. I want page to show me total records/size of page in first go itself although there will be only 2000 records, so that next, previous, first and last button can be used freely and data from server can be brought as and when required.
Has anybody worked on such a thing? I am really stuck with this requirement for over 2 weeks now. Thanks to all in advance. Hope to get an answer soon on this.
I have got it working using localreader which helps me set the total, records and page count to correct values.