i simple want progressbar should execute until it becomes 100 after some interval.but it is not working properly.can anyone help me .Any help would be Greately appreciated.Here is the code what i have written.
Private Sub Timer1_Timer()
For i = 10 To 100 Step 10
ProgressBar1.Value = CInt(i)
If ProgressBar1.Value = 100 Then
Unload Me
Load MDIForm1
MDIForm1.Show
End If
Next i
End Sub
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Password mismatch", vbInformation, "Retype"
Text1.Text = ""
Text2.Text = ""
Text2.SetFocus
End If
If Text1.Text <> "" And Text2.Text <> "" Then
Set rs = New Recordset
rs.Open "select * from Employees_DB_Access where EMP_ID=" & Text1.Text, con, adOpenDynamic, adLockOptimistic
If rs.EOF Then
MsgBox "User ID Mismatch", vbInformation, Me.Name
Text1.Text = ""
Text1.SetFocus
ElseIf Text1.Text = rs.Fields(0) And Text2.Text <> rs.Fields(1) Then
MsgBox "Password is invalid", vbInformation, Me.Name
Text2.Text = ""
Text2.SetFocus
ElseIf Text1.Text <> rs.Fields(0) And Text2.Text = rs.Fields(1) Then
MsgBox "Invalid User ID", vbInformation, "retype"
ElseIf Text1.Text = rs.Fields(0) And Text2.Text = rs.Fields(1) Then
ProgressBar1.Visible = True
Timer1.Enabled = True
Exit Sub
Else
MsgBox "User ID Mismatch", vbInformation, "retype"
Text1.Text = ""
Text2.Text = " "
Text1.SetFocus
Exit Sub
End If
End If
' rs.Close
End Sub