hello! i'm trying to implement an audit trail in my system and what i wanted is that when the user click the login button, infos like username, level of access, time in and date will be save in the database and fortunately i have done it and here is my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
con = New OleDbConnection("Provider=Microsoft.ace.oledb.12.0;Data Source=C:\Users\edenzam\Desktop\CBFMNHS Enrollment System\CBFMNHS Enrollment System\bin\Debug\Enrollment System.accdb")
da.SelectCommand = New OleDbCommand("Select* from AuditTrail", con)
cmd1 = New OleDbCommandBuilder(da)
If con.State = ConnectionState.Closed Then con.Open()
ds = New DataSet
da.Fill(ds, "AuditTrail")
ds.Tables("AuditTrail").Rows.Add()
lastrow = ds.Tables("AuditTrail").Rows.Count - 1
myrow = ds.Tables("AuditTrail").Rows.Item(lastrow)
myrow.Item("Username") = Textbox1.Text
myrow.Item("LevelOfAccess") = LevelofAccessTextBox.Text
myrow.Item("TimeIn") = time.Text
myrow.Item("Dates") = dates.Text
ds.Tables("AuditTrail").GetChanges()
cmd1.GetInsertCommand()
da.Update(ds, "AuditTrail")
con.Close()
end sub
my problem is that on how to save the time out because the time out is in different form..