For the latest documentation on Visual Studio 2017, see Save data back to the database on docs. If you modify that data, it's a good practice to save those changes back to the database.
Connection String = str Connection String cnn OLEDB. Click i = "SELECT Lib_Book1, Lib_Book2, Lib_Book3 FROM members WHERE ID=" & txtmem_id. Command Text = "UPDATE books SET Borrowed_By, Bk_Status, Bk_From, Bk_Due = '" & txtmem_id. Execute Non Query() Msg Box("Transaction Recorded.") txtmem_id. Command Text = "SELECT * FROM attendance WHERE id_no LIKE '" & Txtid. Message) End Try End Sub is a SELECT statement and cannot update anything when this command is executed Said that, I suggest to correctly implement a parameterized query for every part of your query, and, of course, use the correct statement that updates your record sql = "UPDATE attendance SET [email protected]_out, [email protected]_remarks " & _ "WHERE id_no= @id AND date LIKE @dt and am_out is null" Try With com . try catch block is to handle any error for your app, if you got some error, it will throw the reason of error, so you will easy to find the problem and fix it and it will avoid from application crash. Scenario: As the code I use above if I input the row ID I can get it's datas/infos to update the other table as stated in the code above but what if I enter an ID which is not existing in the rows of table how will I code an if else for that to display an errror that ther's no record found? i will give you some UI example, hope give you some idea.
= am_OUT Then remarks = "OVERTIME" Else remarks = "PRESENT" End If sql = "UPDATE attendance SET [email protected]_out, [email protected]_remarks " & _ "WHERE id_no= '" & Txtid. About the Fine when a member borrow a book and exceeds it's due date a fine of 10pesos per day will be collected. Form2.show(), on Load Event Form1 bind your whole member to it, same thing for Form2 bind your whole book list to it, it's not so difficult as you imagine if you try. Every member will pay 400 pesos for registration for 1 year. :) the error was gone the problem is in my database where I set the borrower column to number instead of text that's why it displays an error datatype mismatch.. Public Class Transactions Private Sub Button8_Click(By Val sender As System. Add(New My Sql Parameter("@noon_remarks", remarks)) com. Execute Non Query() If remarks = "OVERTIME" Then Message Box.