Assuming you want to create a new record in an existing Access database table named “tbl_user” with fields “user_id”, “user_cat”, and “psw”, the following VBA code should do the trick: Sub CreateUser() ' Open a connection to the Access database Dim db As DAO.Database Set db = CurrentDb() ' Create a new record in the tbl_user table Dim rs As DAO.Recordset Set rs = db.OpenRecordset("tbl_user", dbOpenDynaset) rs.AddNew ' Set the values of the new record rs("user_id").Value = "yourusername" rs("user_cat").Value = "admin" rs("psw").Value = "*******" 'replace *** with your password ' Save the new record and close the recordset and ...
Read More »