Avatar billede puppetmaster Nybegynder
28. juni 2005 - 10:59 Der er 2 kommentarer og
1 løsning

Felt vil ikke opdatere

Min database henter data fra Navision vha. queries, som godt kan tage 8-10 min. pr. stk.
For at give lidt feedback, har jeg tilføjet et felt på formularen, som kan vise hvor lang tid der er gået siden en query blev sat i gang.
Hvis jeg blanker alle queries ud i koden, er der ingen problemer, "stopuret" starter fint, men så snart der skal hentes data fra Navision, så bliver formularens kontroller, her i blandt stopuret, IKKE opdateret. Hvorfor og kan man gøre noget ved det?
Avatar billede terry Ekspert
28. juni 2005 - 12:01 #1
try looking at the doevents function


DoEvents Function
     

Yields execution so that the operating system can process other events.

Syntax

DoEvents( )

Remarks

The DoEvents function returns an Integer representing the number of open forms in stand-alone versions of Visual Basic, such as Visual Basic, Professional Edition. DoEvents returns zero in all other applications.

DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent.

DoEvents is most useful for simple things like allowing a user to cancel a process after it has started, for example a search for a file. For long-running processes, yielding the processor is better accomplished by using a Timer or delegating the task to an ActiveX EXE component.. In the latter case, the task can continue completely independent of your application, and the operating system takes case of multitasking and time slicing.

Caution  Any time you temporarily yield the processor within an event procedure, make sure the procedure is not executed again from a different part of your code before the first call returns; this could cause unpredictable results. In addition, do not use DoEvents if other applications could possibly interact with your procedure in unforeseen ways during the time you have yielded control.
Avatar billede puppetmaster Nybegynder
28. juni 2005 - 12:33 #2
Hmmm....need to have/nice to have....I have given up on implementing the timer...sigh.
Thanks anyway, terry. The DoEvents didn't work either.
Avatar billede terry Ekspert
28. juni 2005 - 21:09 #3
have you looked at the progress bar? Cant recall using it myslef but it may solve your problem.

I think the Doevents function has to go between queries, so youy are only going to see the update then, not progessivly as each query runs

og tak :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester