By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

Progress bar

100+
P: 284
i am using vb6

i have a follwing code which insert data into the table

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. ‘ Note fromint and toint can be any interger like 10000 -12000 inputed by user
  4.  
  5.  
  6.  
  7. For a = fromint To toint
  8.  
  9. Dim numberstr As String
  10.  
  11. Dim numbercmd As Command
  12.  
  13. Set numbercmd = New Command
  14.  
  15. numberstr = "INSERT INTO invtemp    ([Invoice No]) VALUES     (" & a & ")" ‘There are more field but I remove them to simplify it
  16.  
  17. numbercmd.ActiveConnection = con
  18.  
  19. numbercmd.CommandText = numberstr
  20.  
  21. numbercmd.Execute 
  22.  
  23. End If
  24.  
  25.  
  26.  
  27. Next a
  28.  
  29.  

the code is working fine and now i want to add a progrss bar to it so i can show user how much time it takes
proviosly i have no experien using a progress bar

i had try it my making like this

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. ‘ Note fromint and toint can be any interger like 10000 -12000 inputed by user
  4.  
  5.  
  6.  
  7. ProgressBar1.Min = fromint
  8.  
  9. ProgressBar1.Max = toint 
  10.  
  11. For a = fromint To toint
  12.  
  13. Dim numberstr As String
  14.  
  15. Dim numbercmd As Command
  16.  
  17. Set numbercmd = New Command
  18.  
  19. numberstr = "INSERT INTO invtemp    ([Invoice No]) VALUES     (" & a & ")" ‘There are more field but I remove them to simplify it
  20.  
  21. numbercmd.ActiveConnection = con
  22.  
  23. numbercmd.CommandText = numberstr
  24.  
  25. numbercmd.Execute
  26.  
  27. ProgressBar1.Value = ProgressBar1.Value + 1
  28.  
  29. End If
  30.  
  31.  
  32.  
  33. Next a
  34.  
  35.  


but it is giving me error on minimum value

how to slove this
Jun 30 '08 #1
Share this Question
Share on Google+
3 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Slight Tricky over here...
Always For progressbar, Max value should be Greater than Min, Or else, it errorrs..
So you need to reverse the condition... First Set Max and then Min, or First set Min =0

ProgressBar1.Min = 0
ProgressBar1.Max = 12000
ProgressBar1.Min = 10000


Regards
Veena
Jun 30 '08 #2

100+
P: 284
OK I will try it like this by reversing it



Hi,

Slight Tricky over here...
Always For progressbar, Max value should be Greater than Min, Or else, it errorrs..
So you need to reverse the condition... First Set Max and then Min, or First set Min =0

ProgressBar1.Min = 0
ProgressBar1.Max = 12000
ProgressBar1.Min = 10000


Regards
Veena
Jun 30 '08 #3

100+
P: 284
Thanks its now working properly
Jun 30 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.