I have a form named "Form1" and it has a Textbox named "Test" i would like to update the table "tbl_Room" in the field of "RoomNoOccupant" using vba. what would be the code for updating the field. thanks...
You need to open connection to your database. If the databse were local database (from mdb itself), after that just use some standard SQL query
Dim con as new ADODB.Connection
Set con = CurrentProject.Connection
con.execute"UPDATE tbl_Room SET RoomNoOccupant = '" & test & "' " & _
"WHERE RoomCode = " & Emp_Room & ";"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.