hi,
Im been searching through loads of posts to see how I can do this, but Ive nearly cracked it..
I want to have a progress bar based on the current recordset. (See code)
But everytime I run it I get the following error:
run-time error 380
Invalid Property value.
Now i think this has something to do with the min/max on the progress bar but I cant figure it.
Any help would be appreciated
Dim strConnection As String
Dim Con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strSQL As String
strConnection = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=d:\sbt\data;"
strSQL = "Select ProdDescID, Brand, Class, ShortText, last_upd, ProdDescr " & _
"From PrDesc01 where brand ='" & cboBrand & "'"
Set Con = New ADODB.Connection
Set rs = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
Con.ConnectionString = strConnection
Con.Open
rs.Open strSQL, Con, adOpenKeyset, adLockOptimistic
ProgressBar1.Min = 0
ProgressBar1.Max = rs1.RecordCount
Do While Not rs.EOF
ProgressBar1.Value = ProgressBar1.Value + 1
Loop
end sub
thanks
Im been searching through loads of posts to see how I can do this, but Ive nearly cracked it..
I want to have a progress bar based on the current recordset. (See code)
But everytime I run it I get the following error:
run-time error 380
Invalid Property value.
Now i think this has something to do with the min/max on the progress bar but I cant figure it.
Any help would be appreciated
Dim strConnection As String
Dim Con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strSQL As String
strConnection = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=d:\sbt\data;"
strSQL = "Select ProdDescID, Brand, Class, ShortText, last_upd, ProdDescr " & _
"From PrDesc01 where brand ='" & cboBrand & "'"
Set Con = New ADODB.Connection
Set rs = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
Con.ConnectionString = strConnection
Con.Open
rs.Open strSQL, Con, adOpenKeyset, adLockOptimistic
ProgressBar1.Min = 0
ProgressBar1.Max = rs1.RecordCount
Do While Not rs.EOF
ProgressBar1.Value = ProgressBar1.Value + 1
Loop
end sub
thanks