Elapsed time

A

Anthony Viscomi

I have the following code:
Set dbCurr = CurrentDb()
SysCmd acSysCmdInitMeter, "Working on CCE Template Updates"
lngCount = 0

For Each qryCurr In dbCurr.QueryDefs
lngCount = lngCount + 1
SysCmd acSysCmdUpdateMeter, lngCount

With qryCurr

If Right$(.Name, 4) = "_XLS" Then
.Execute dbFailOnError
clsRidesPBar.IncOne
End If

End With
Next qryCurr
SysCmd acSysCmdClearStatus

I also have a confirmation message (actually a form that opens) that is
displayed once this action is complete. I would like to somewhere display
the elapsed time it had taken to perform the above action. Is this possible?
How?

Thanks,
Anthony
 
T

Tom Wickerath

Hi Anthony,

Yes, it should be possible. I think this KB article will provide a good start:

Use QueryPerformanceCounter to Time Code
http://support.microsoft.com/?id=172338

Tom
_______________________________________


I have the following code:

Set dbCurr = CurrentDb()
SysCmd acSysCmdInitMeter, "Working on CCE Template Updates"
lngCount = 0

For Each qryCurr In dbCurr.QueryDefs
lngCount = lngCount + 1
SysCmd acSysCmdUpdateMeter, lngCount

With qryCurr

If Right$(.Name, 4) = "_XLS" Then
.Execute dbFailOnError
clsRidesPBar.IncOne
End If

End With
Next qryCurr
SysCmd acSysCmdClearStatus


I also have a confirmation message (actually a form that opens) that is
displayed once this action is complete. I would like to somewhere display
the elapsed time it had taken to perform the above action. Is this possible?
How?

Thanks,
Anthony
 
J

John Flanagan

1. Create a label to display the elapsed time (lblTimeElapsed for example)
2. Adjust your code as follows

dim StartTime as date
StartTime=Now
doevents
set dbCurr=CurrentDb()
..
..
clsRidesPBar.IncOne
End if
lblTimeElapsed.Caption = Now-StartTime
doevents
..
..
SysCmd acSysCmdClearStatus
msgbox "Total Time Taken: " & Now-StartTime ' or maybe write the time
elapsed to a label on your confirmation form

Hth
John
 
A

Anthony Viscomi

Do I need to do some type of conversion? The result is in integer or
exponential format.
Ex. 8.3333134E1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top