Sleep() and Form_Timer() conflict


I am using this function to make Access wait a bit:

Private Declare Sub Sleep Lib "kernel32" (ByVal millisecs As Long)
Sleep (1000)

The problem is that in the same form, Form_Timer() is running and once
Sleep() starts, the timer stops running (copying some variables to
some text boxes, once, every 125 miliseconds).

Can I have some help, please?

H. Martins

11/9/2007 3:06:28 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 2

Try the following function instead of Sleep:

Public Function Pause(NumberOfSeconds As Variant)
'-- For use where you want to pause but still let
'-- Access have some computer time.
'-- From ghudson on Access World Forums
On Error GoTo Err_Pause
    '-- Called with - Pause (.5) for a half second pause
    Dim PauseTime As Variant, Start As Variant
    PauseTime = NumberOfSeconds
    Start = Timer
    Do While Timer < Start + PauseTime
    Exit Function
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Pause
End Function

H. Martins wrote:
>I am using this function to make Access wait a bit:
>Private Declare Sub Sleep Lib "kernel32" (ByVal millisecs As Long)
>Sleep (1000)
>The problem is that in the same form, Form_Timer() is running and once
>Sleep() starts, the timer stops running (copying some variables to
>some text boxes, once, every 125 miliseconds).
>Can I have some help, please?
>H. Martins

RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via

11/9/2007 3:48:25 PM

Similar Artilces:

POP3 conflict OL2000/2003
I have a problem affecting W2K users having roaming profiles and different versions of Outlook installed on different computers. I wonder if anyone has a solution to this other than the most obvious to just upgrade everyone to Office 2003 right away. Network is W2K Server with W2K Pro workstation. All users have roaming profiles. User's Desktop has Office 2003 Professional installed. Outlook 2003 is configured for both Exchange 2000 and POP3 accounts. User's Notebook still has Office 2000 Professional installed. Outlook on it was configured identically. Once the user&...

conflict between Unicode and non-Unicode builds?
We just had a really strange error that took a while to diagnose. An ISAPI extension running under IIS tried to CoCreateInstance a particular COM component and was getting a failed HRESULT for "Access is denied". While this was not happening under Windows 2000, IIS 6.0 on Windows 2003 wouldn't work all the time. On one server we could get it to work by switching IIS 6.0 to use 5.0 Isolation mode and setting the ISAPI extension to Low isolation, but on another server this didn't seem to have an effect. The break came for us when I tried running Sysinternal's Filemon ut...

sleep not in vista
I�m using windows vista home premium and trying to get sleep on the shutdown menu. There is no sleep or hibernate on the shutdown menu. When going into power options and advanced power options, I�m unable to set the default to sleep. I have set to high performance. There is only 2 options which are �shutdown or do nothing� When clicking on the sleep option all that is there is �do nothing�. Can anyone help? -- allyann ------------------------------------------------------------------------ allyann's Profile: View this thr...

Don't put computers to Sleep after a meal
If you plan to put your computer to sleep when stepping out, make sure you didn't feed it fatty foods. Else it's a growing problem now when computers wake up from Sleep with bloated RAM, or worse - stiff harddisk. It's always best to include the initial feeding tube of Sheep when entering into the Computer arena because sleeping computers just don't allow Chinese workers to do justice to what they do best. After all, this is America and we can expect better plants when giving off green house gases. Of course they will get annoyed but what else can they do? ...

Coreldraw Mapi32 conflict
All- We discovered that installing Coreldraw will overwrite the mapi32.dll file causing this error to come up when you run Outlook: "The required file mapi32.dll cannot be found in your path, please reinstall Microsoft Outlook" Removing Coreldraw did not fix it. Uninstalling and then reinstalling Outlook did not fix it. I have deleted mapi32.dll and am in the process of hacking the registry to find references to the corrupt file. Just a word of warning... ...

Conflicting answers re web based e-mail
We are considering buying exchange server and wonder if it is possible to still use our web-based e-mail system. Only a few people would be using the exchange server and we don't want to switch everyone over. Thanks in advance for your help! Kris "Kris" <> wrote: >We are considering buying exchange server and wonder if >it is possible to still use our web-based e-mail system. >Only a few people would be using the exchange server and >we don't want to switch everyone over. > >Thanks in advance for you...

Custom chart gallery and range name conflicts
When I create a user-defined chart type, Excel seems to copy lots of range names to the file xlusrgal.xls. Is there a way to stop it doing this because it is triggering lots of problems. It creates a range name conflict when I try to create a new user-defined chart type, unless I run a macro like: Sub deletenames() For Each myname In ActiveWorkbook.Names myname.Delete Next myname End Sub in xlusrgal.xls Is there any way round this? I get this problem using Excel 97 and 2000 (I don't have XP or 2003). (let me know if this question should have been asked to microsoft.public.excel.progr...

Conflicting device resources
Hi Guys, The background: we have a custom device on the LPC bus mapped to $4400-$47FF in I/O space. This address space is partitioned between a number of drivers. The drivers are all working, but some report a conflict with "Motherboard resources". Some drivers have a custom install class. OS is WinXPe. I'm currently re-working the driver suite for a 2nd revision of the hardware. As part of the process, I'm writing a "bus driver" that will claim the entire address space, and then create PDOs for child devices with their own drivers, because it's nea...

Conflicting calendar updates
Exchange 5.5 all SP's and patches applied, Outlook 2000. I'm having trouble with two Administrative Assistants, Evelyn and Donna, trying to update a corporate calendar in a mailbox entitled Calendar - OIS. Larry is the Exchange Administrator. Evelyn is the default NT user on the account, Donna has User permissions in Exchange Administrator. We've also tried it without giving Donna User permissions in Exchange, just Editor permissions in Outlook, with the same results. Help? Desc: 1. Evelyn is an owner of an Outlook Calendar. 2. Larry is an owner of the same Outlook calendar. 3. D...

Help Needed With Write Conflict Error Message.
I have an order form that users open and close on a regular basis. The form is based on a query. On the form are two fields, "TicketPrinted" and "RevisedDate". Most of the time the field "Ticket Printed" has a value in it of "Yes". What I want to be able to do is that if a date is entered into this "RevisedDate" field, OR if the information is changed in this "Revised Date" field, that when the user closed the form, an update query runs that changes the "TicketPrinted" field from the original value of "Yes"...

New Macbook Pro 2009 & Microsoft Conflicts
Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I just bought the new Macbook Pro 2009. With black key board. I installed my original Microsoft Office 2004. and now I cant seem to read any files before 2003 on my computer. I forward the documents to other people with a macbookpro 2008 (4, 1) and they can open no problem as I could on my mac book 2004. While on excel I am also experiencing the program shutting down in the middle and not saving things that I saved while adding info. I am at a loss. The reason I dont buy 2008 is because I work with point zero programing for work a lot...

iPod and HP All-in-One conflict(s)...
I have a new build running 64 bit Vista Ultimate sp2. It has 2 SATA hard drives (C: & X:) , 1 SATA CD-ROM drive (F:) and a USB-connected HP Officejet 6500 All-in-One printer. It runs [almost] everything perfectly. The "almost" comes from the fact that it will connect and synch an iPod Touch device with iTunes perfectly just so long as the HP Officejet 6500 All-in-One USB-connected printer is not installed or, at least, not connected. Also, since the iPod has been installed there seems also to be a conflict with the printer's scanner device. I suspect that t...

Conflict between libcmt.lib and msvcrt.lib. How to resolve ?
My project uses msvcrt.lib, but I have a single static library which apparently uses libcmt.lib, because when linking, I get a plenty of errors : libcmt.lib : error LNK2005: _calloc already defined in msvcrt.lib I have no source files of that library, can I still force it to use msvcrt.lib ? I prefer not to change my big project because of a single small library. Thanks in advance, Kamil Consider using /nodefaultlib:"libcmt.lib" in your project's linker options. "kamil" <> wrote in message news:%2357xWTG7GHA.3452@TK2MSFTNGP0...

trying to minimize Write Conflicts in a multi-user database
I have a multi-user Access 2003 database and lately a number of our users are running into the Write Conflict message gives them the choice to either Save Record, Copy to Clipboard or Drop Changes. The problem occurs in a tabbed form with subforms on the different pages. I have been told by several developers that one way to minimize the occurrence of the Write Conflict is to put the main form's controls into a subform and remove the Record Source from the main form. You then set Child and Master Field links in the subforms to the value returned by the record selection c...

Junk email and conflicts folder #2
Hi Using Outlook 2007 and Exchange 2003 Anything that appears in junk email is duplicated into the conflicts folder Any ideas on how to stop this ? Thks ...

"Name Conflict" when Excel 2007 open an old worksheet
Hi all, An "Name Conflict" error message pop-up "Name cannot be the same as a built-in name". That worksheet was created by Excel 2000 and also could open on Excel 2003 without any error message. Change the worksheet file name could not solve the problem after tested. Why? Thank you, Chik "Chik" <> wrote... >An "Name Conflict" error message pop-up "Name cannot be the same as >a built-in name". That worksheet was created by Excel 2000 and also >could open on Excel 2003 without any error message. Change th...

Outlook 2000 (office version) and IE7
Having recently installed IE7 I now find that email from my pop3 accounts only work spasmodically ie when the accounts are freshly configured in Outlook 2000. I have saved them as *.iaf files so have to remove them from outlook and them re-import them each time I re-open outlook to check my email. They work fine as long as I don't close outlook. The error message reads: A TCP/IP error occurred while trying to connect the server. (Account: 'BT', POP3 Server '', Error Number 0x800ccc15). Any ideas as to how to fix this one? Thanks, Helen Jones Egg...

No sound after sleep
Whenever I put my computer into sleep mode it restarts with no sound. I have the latest drivers installed and all Windows updates. If I start Media Player and click on a music track I get an error message saying there is an error with my sound device, there might not be one, it might be in use by another program or it is not functioning properly. A reboot solves the issue. I have searched on Google and found hundreds of others with the same problem (nearly all with HD audio like I have) but I can't find a solution. It seems to be a generic problem with Windows 7 64bit...

Microsoft Offide for Mac 2004 Causes Sleep Problem
After installing the latest update for Office for Mac 2004, my G4 will not fall asleep automatically according to the setting in System Preferences. I can put it to sleep manually, but since I don't always know when I am not coming back to the computer for awhile, this is an issue for me. Can anyone help? Is it possible to uninstall this update, or would it involve uninstalling all the Office apps and starting over? I sure hope not. H.G. On 5/28/07 5:34 PM, in article, "" <> wrote: > A...

Web.Extensions 3.5 conflicts with 1.0.61025
I have a Webapp which was developed for framework v2.0/lower, it references System.Web.Extentions 1.0.61025.0 I installed .net 3.5 on that box and the working webapp starts failing with the below error: error CS0433: The type 'System.Web.Script.Services.ScriptMethodAttribute' exists in both 'c: \WINDOWS\assembly\GAC_MSIL\System.Web.Extensions \1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c: \WINDOWS\assembly\GAC_MSIL\System.Web.Extensions \\System.Web.Extensions.dll' There is no where System.Web.Extensions 3.5 is re...

Conflict between MSN Search Toolbar and MS CRM
After I installed the MSN Search Toolbar on 2 computers running XP, I noticed that MS CRM had suffered: The background colors on the fields in the MS CRM forms had randomly changed from the normal all-white to background colors of yellow and green and sometimes white. Anybody else have the problem or have a fix? In a cross-post to the MSN Search forum, I received the following reply which solved the problem. I changed the preference in the MSN Search Toolbar and it worked perfectly. dcmacdon "Charles Oppermann" wrote: > Sounds like the form fill function is coloring t...

10x Conflict Message from Public Folder Store
Hi We have received 5+ duplicate messages (some with attached duplicate messages) in our public folder store. In addition 10 conflict messages sent to the public folder and all active directory users on the network. The source of the original message is legit (one of our printers informing the toner is low). Multiple edits have been made to "Event:BLACK TONER LOW". The conflicting edits have been attached to a conflict message in "Enquiry". I have disabled the printer from sending emails and have sent a test email to the public folder which arrived without problem. Wh...

Conflicting IP Address
I seem to be having an error for conflicting IP addresses on my system? This just started to happen recently, last couple of days. I can't seem to figure out why, I have not done anything differently. I have noticed that since I set up cable internet, it has happened more often (1 month), since it hasn't happened in over a year before I had internet access, I figure this may be a cause...any ideas? I have the router & main computer in the back office. Then two registers up front, all wired to the router. -- Thank You Vince :) There are a couple different approaches to...

Outlook conflicts with WinFax Pro v 10
I have problems with Outlook 2003 and WinFax Pro v 10. Whenever I click on the "Outlook, WinFax Fax Logs" folder the Outlook 2003 no response only the solution I have right now is uninstalled the WinFax. I did customized installation many times such as installed without E-mail feature but always I got the "WinFax Fax Logs" folder in "Outlook 2003" so I have the same problems again and again. So I am looking for your help to fix this problem. Thanks in advanced. Regards, Nee Did you check with Symantec? This is a known issue which I presume they have no ...

Distribution List Conflict
I set up a distribution list in Outlook and gave it a name. Then I needed to remove one email address from the distribution list. Since I couldn't figure out how to remove one email address from the list, I just deleted the list and created a new list using the same name. My outlook auto-fills previously entered email addresses in the To field and now whenever it auto-fills the distribution list name, it says that distribution list is no longer valid. This is most likely happening because the distribution list I deleted had the same name as the new one I replaced it wit...