[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access form refresh / re-calculation delay

Posted on 2013-05-20
3
Medium Priority
?
1,159 Views
Last Modified: 2013-05-27
I have an Access database front-end with an SQL Server back-end. The main form consists of several sub-forms (containing simple totals) and various text-boxes, some of which are calculated based on sub-form totals.

It's actually a quoting application, whereby the sub-forms for materials / labour etc. are totalled up to give an overall cost, with additional input fields for discount / markup etc. The main 'quote' record is linked to several other tables for materials used, labour required etc. Normal sort of stuff I guess.

An initial problem meant that all the calculations were not correct if a user modified a field and then pressed print without the record being updated. To resolve this,  I now refresh/requery the form to ensure any field the user is currently in is updated and all calculations are correct (especially the overall quotation value of course). I found I had to add a fixed delay before printing to enable everything to refresh otherwise the printed quote did not correspond to the correct values on-screen. However, on some slower machines this is not long enough  - the delay is already up to several seconds which is getting a bit ridiculous as far as users are concerned.. normally pressing print should at least show a preview in a reasonable time.

Does anyone have any ideas how to resolve this, whether it be a better way of ensuring everything is up-to-date on the form before printing or telling me there's something obvious I've missed in all of this?

Thanks
0
Comment
Question by:nigelr99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Assisted Solution

by:chaau
chaau earned 450 total points
ID: 39182988
Didn't you need to do Update method, instead of refresh/requery?

Use Update with Force parameter set to TRUE. This will ensure the data is saved to the database
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1050 total points
ID: 39187168
How are you doing the "refresh/requery"? In most cases, if you want to force Access to save the data you just do this:

If Me.Dirty Then Me.Dirty = False

This forces Access to save any changes. Refreshing/requerying can take quite a bit of time, depending on many different factors (network speed, data size, UI complexisty. Saving data is very fast in most cases
0
 

Author Closing Comment

by:nigelr99
ID: 39199385
Sorry for slow reply, didn't have the chance to test for a few days. Taking the 2 replies I had, I realised that I didn't really need to requery as it meant the subforms were also requerying as well which seemed to take the most time.
In the end, I replaced the requery with a simple docmd.Save which seems to have done the trick for the time being.
I've awarded some points to each reply, hopefully the split is agreeable.
Many thanks
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question