Link to home
Start Free TrialLog in
Avatar of Ogueds
Ogueds

asked on

VB Load time display

I've designed screen with a progress bar while the system loads data to my recordset through ODBC.  How would I incorporate a timer display which will diplay in seconds how long the process takes, start timer will be at loading the form and ending once this finishes loading. I need to display the timer in the foreground while other forms load in the background (frm2.hide).  this will provide a user with feedback in how long the forms take to load.

Thank you for your expert help !

ogueds
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KDivad
KDivad

Haven't tried it, but it looks like a change needs to be made. Ignore me if I'm wrong:

If S = 59 Then
   S = 0
   If M = 59 Then
       M = 0
       If H = 24 Then

Should be:

If S = 59 Then
   S = 0
   M = M + 1
   If M = 59 Then
       M = 0
       H = H + 1
       If H = 24 Then
almost....

S = S + 1
If S = 60 Then
  S = 0
  M = M + 1
  If M = 60 Then
      M = 0
      H = H + 1
      If H = 25 Then
           H = 0

But let's just hope your process doesn't take that long :)

francois
Rats! Got a chance to show off and screwed it up! <grin>

If he needs more than just the seconds, I hope I never accidently run that procedure!
fpaire, KDivad, i didn't understand you, guys!
I tried that code to almost 15 minutes without any problem.
(I didn't test it to an hour or 24 hours either)
did you check carefully richie?

i'm sure it will skip from 58s to 0s, 58m to 0m.

francois
It displays 59, then, next second it displays 1:00.
Oops, he's right. Didn't look close enough. ^*$&@# font makes reading code dificult...
Avatar of Ogueds

ASKER

I'm still having problems displaying the timer form in the foreground while. other forms load in the background.  help how do I do this ?

Thank you
Sorry, i think i don't deserve a B grade so i will not post any other comment.
Cheers
You should never give less than an A unless you have asked the expert for more help and they didn't do so. In this case, you just accepted with a low grade instead of requesting help with the additional problem first. I agree completely with Richie's choice.
Avatar of Ogueds

ASKER

I sound like you guys are on an ego trip.  Are u guys trying to help other users or just worry about ratings.
Excuse me I'm new in this forum.

Thank you.
Sometimes, i post only clues or guesses without take care if i got points or not, just for the sake of help another guy.
This time, the code posted works 100% so this is nothing to do with ego or something like that.
I am the first person to accept if my post is awfull, middle-solution, just right or complete functional.
You could see my profile and if you encounter other threads were i was participating, you will see with your own eyes.
Cheers.
I'm not here for the points either.

You accepted the answer as it stands. Richie has gotten a lower grade than he would have gotten if you had asked for more help before accepting. Now, even if he fixes your problem, he can't get his rating back to where it could have been.

It's not so much that we worry about the rating, it's just the principle of the matter. When you post here, you agree to follow the guidelines for the way things are done. In this case (and in almost every other one I've read), it doesn't appear that you've read those guidelines. If I had the link, I'd post it word for word, but it basically says what I put in my previous post. Ask for more help and then give a lower grade only if more help doesn't occur.

(Maybe they should give tests on the quidelines as part of signing up to make sure people read them!)
KDivad, i agree with you and we have been crossing each other in other task and you don't let me cheat with i am talking.
Eh? I don't let you cheat? I don't recall when you've tried...

I noticed that I had been seeing your name here alot!
I mean, you know me from others tasks and you know that my thinking is almost clear on those matters.
Ah, ok. Yeah, you're right. From what I can gather of you from this board, you seem to be level-headed and fair. A rare combo in these days of almost-anonymity...
That's why I had no trouble adding my support.
interesting...

back to the heart of the matter... Ogueds, you still need help on getting that form to the foreground? if so, i will need to know how you load and display your forms.

sometimes, a simple DoEvents() and/or [Form].Refresh in the right place will do the trick. On other occasions, an out-of-process call is needed to have things run smoothly and independantly.

tell me what you're doing and we'll see how we can make it work.

francois
Avatar of Ogueds

ASKER

Thank you Richie for your support.  I will be more carefull about grading in the future.  You can take advantage of the additinal points I've offered.

Ogueds
Avatar of Ogueds

ASKER

fparie

I'm loading a form with a progressbar based on a loop, to give the user an indication that something is happening.  after the progressbar is completed then the main forms get loaded with form.hide. the main forms connect to the backend and load the recordsets (about 8k records) while this is happening in the background I would like to display a timer along with the progress bar to show how long the hidden forms take to load.hide.

thank you.
Ogueds, thanks but the point is not about points(pun not intented;).
<< I will be more carefull about grading in the future. >>

That's all we ask. Thanks for understanding our view!

KDL
the most simple solution would be to have the loop that is actually loading your data also update the value of the progressbar. after doing this call the refesh method of the form displaying the progressbar and after that insert a DoEvents() into your loop. make sure you use a seperate module for loading the data. that should keep your progressbar visible throughout the process. if this doesn't solve it for you i have a stronger solution but that will be a little more complicated to explain so you may want to try this first.

good luck,
francois