Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim AM As String = "8:01:00 AM"
Dim remarks As String
If LblTime.Text >= AM Then
remarks = "LATE"
Else
remarks = "ON TIME"
End If
Try
With com
.Connection = con
.CommandText = "SELECT count(*) Searchflag from employees_records where id_no='" & Txtid.Text & "' and date like '" & LblDate.Text & "';"
End With
sql = "INSERT INTO attendance (id_no, am_in, am_remarks, date) VALUES (@id_no, @am_in, @am_remarks, @date)"
com.Connection = con
com.CommandText = sql
com.Parameters.Add(New MySql.Data.MySqlClient.MySqlParameter("@id_no", Txtid.Text))
com.Parameters.Add(New MySql.Data.MySqlClient.MySqlParameter("@am_in", LblTime.Text))
com.Parameters.Add(New MySql.Data.MySqlClient.MySqlParameter("@am_remarks", remarks))
com.Parameters.Add(New MySql.Data.MySqlClient.MySqlParameter("@date", LblDate.Text))
com.ExecuteNonQuery()
If remarks = "LATE" Then
MessageBox.Show("Hurry up your Late")
ElseIf remarks = "ON TIME" Then
MessageBox.Show("Very good you come on time!")
End If
Catch ex As Exception
End Try
i can't retrieve the id_no from another table mysql is my database
End Sub
"I can't retrieve the id_no"
. – Bjørn-Roger Kringsjåat sign
and select its name. In this way a comment icon is displayed on destination user. – Steve