by the way. this is now my problem.
THIS IS FOR TIME IN...
Private Sub cmdIN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIN.Click
lblempno.Text = txtempno.Text
lblIN.Text = lbltime.Text & lbldate.Text
MsgBox("Log in successful!", vbInformation)
lv = ListView1.Items.Add(lbltime.Text)
txtempno.Text = ""
txtempno.Focus()
End Sub
THIS IS FOR TIME OUT...
Private Sub cmdOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOut.Click
If lblIN.Text = "" Then
MsgBox("Failed to save Log in first.")
txtempno.Text = ""
txtempno.Focus()
Exit Sub
End If
If txtempno.Text = "" Then
MsgBox("Please put your employee number", vbExclamation)
txtempno.Focus()
Exit Sub
End If
Try
lblOUT.Text = lbltime.Text & lbldate.Text
con2.Open()
Dim cmd As New SqlCeCommand("insert into tbl_timerec(EmpNo, TimeIN, TimeOUT) VALUES('" & lblempno.Text & "','" & lblIN.Text & "','" & lblOUT.Text & "')", con2)
dr = cmd.ExecuteReader
dr.Read()
MsgBox("Log out sucessful!", vbInformation)
lv.SubItems.Add(lbltime.Text)
con2.Close()
lblIN.Text = ""
lblOUT.Text = ""
lblempno.Text = ""
txtempno.Text = ""
txtempno.Focus()
Catch ex As Exception
MsgBox("[ERROR]" & ex.Message)
txtempno.Text = ""
txtempno.Focus()
End Try
End Sub
E.G:
if the user1 time in and the user2 will time too, [hours later] if the user1 will use the time out it will go to the last row [last row is user2].
so i want is if the user1 will use the time out using his Employee number it will go to the row the when he time in.