Solved

Sleep vs Timerinterval

Posted on 2011-03-02
9
703 Views
Last Modified: 2012-08-13
Which is better (or are they the same) Sleep or Timerinterval? I have a form where onCurrent I need to establish some variables, count the # of days based on a couple dates, and a couple of other calculations.

I also have code behind the column headings (on a continuous form) to sort the contents of the column --

if me.orderby="FieldName" then me.orderby="FieldName DESC" else me.orderby = "FieldName"

The onCurrent bogs down the sort -- so I put the culprit code in a timer -- but it still seems that things keep running too slowly.

I have tried Application Echo and the DBEngine.Idle dbRefreshCashe ---

Nothing seems to work.

This is not a large db. It's a FE/BE (.accdb) with about 8 users consecutively. The BE never grows beyond 30mb.

The form is bound because it requires real-time updates available to all the users.

Any suggestions that would help me speed things up would be appreciated.

Thanks a lot!!



0
Comment
Question by:Ei0914
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Expert Comment

by:ComputerAidNZ
Comment Utility
Sleep performs its code after a certain time - once; TimerInterval repeats the process after specified time, again and again.
Probably best to use OnForm, since this will run the code every time the form is opened - don't use OnTimer since this can cause issues.
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
But why would the sorting be affected but the code in the current event, which is only going to execute when you open the form and/or go to a different record.  You wouldn't be clicking the column sort during that time, right?
Also ... this is why I started using datasheet views instead of continuous forms a long time ago, to take advantage of all the built in right click sort/filter etc.  I used to do the column sort thing also.

Overall, not seeing why you would need a timer or Sleep for any of this ...?
0
 

Author Comment

by:Ei0914
Comment Utility

When you resort a form the OnCurrent event fires because a new record becomes "Current" upon sort.

This is a Dispatch Management system with several dispatchers moving through the records and assigning drivers, calculating charges/fees based on # days out (when initial order was entered to when the dispatcher says the move is completed), etc. It's a truly real-time application.

We thought this might be a networking issue: so, they replaced the NIC card. This client gets access to their server (as they are a branch office) through Remote Desktop. Initially, when I took over support of the application, all the users had their own copy of the front-end, all in the same directory on the server.

So I created a batch file to copy the FE to the users local C: drive (in their Remote Desktop Session) which may not have any impact since the C: drive in that scenario is virtual -- and the processing is probably dragging down server performance regardless of where it is --- am I right about that or not? I'm not a network specialist and they don't have one on staff to help with me that question.

I wouldn't need a Timer if the performance of the form was so poor. I'm trying to put some of the calculation off to the side if possible (which is why I am using the Timer) ---

It is also a tabbed form - and as they change tabs the recordsource changes -- a delay there is acceptable. But in one tab -- where there are only 30-40 records, you'd think there were a million records in the view the way the form is performing.

I want to eliminate anything I may be doing before putting the "blame" on the network or hardware. I would appreciate any suggestions on how best to handle this with regard to the remote desktop too.

Thank you so much for responding, and for your help. I'm ready to pull my hair out.

Eileen
0
 

Author Comment

by:Ei0914
Comment Utility
Opps : I wouldn't need a Timer if the performance of the form was'nt so poor.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Accepted Solution

by:
ComputerAidNZ earned 250 total points
Comment Utility
When  I'm troubleshooting code such as you are doing I put the code in a button and fire it manually, iron out all the bugs, then move the code to an event, then delete rthe button.  BUt the manual firing will show if it is the code of the event that is causing the error.  PS I've had numerous issues with MS Access timer events and coding issues that are OFTEN cured by re-creating the form from scratch and slowly adding the code to the new form.  What happened I don't know, but it obviously solved the issues MANY times
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
Comment Utility
Well, I have to agree that ...  the Timer event can be problematic at times.

"- am I right about that or not?"
I really don't know.  Really have not done anything with RD ... one client has a Terminal Server setup and that is fast.

What is the nature of the code running in the On Current event?
0
 

Author Comment

by:Ei0914
Comment Utility
Thanks you guys/gals(?) -- I'll try that. I'll split the points. I appreciate your help. If you can think of anything else, I'd be happy to hear about it.

Eileen
eileen@epmconsultinginc.com
0
 

Author Closing Comment

by:Ei0914
Comment Utility
Rec'd great direction. Thanks as always!
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
guy :-)
mx
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now