I looking for a solution for the following problem in access.
I have a database studentreview. with the name of the student, the location of the student the course and the status of the course. What I am trying to do is when a condition is meet the name of the course "Anatomy" is meet and the status "Done" is meet I want to auto-generate a new record with the same student name with the same town and the course will be "anatomy 2" and status "not done". The name of the student and the location are linked tables with the studentreview table. This is what is did with a record set but clearly I am doing something wrong since nothing is happening
Public Sub AddRecordset()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblStudentreview")
rs.AddNew
rs.Fields("FirstName") = "Jane"
rs.Fields("Location") = "Newyork"
rs.Fields("Course") = "Anatomy"
rs.Fields("Status") = "Done"
rs.Update
rs.Close
Set rs = Nothing
db.Close
End Sub
Thank you in advance guys
I have a database studentreview. with the name of the student, the location of the student the course and the status of the course. What I am trying to do is when a condition is meet the name of the course "Anatomy" is meet and the status "Done" is meet I want to auto-generate a new record with the same student name with the same town and the course will be "anatomy 2" and status "not done". The name of the student and the location are linked tables with the studentreview table. This is what is did with a record set but clearly I am doing something wrong since nothing is happening
Public Sub AddRecordset()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblStudentreview")
rs.AddNew
rs.Fields("FirstName") = "Jane"
rs.Fields("Location") = "Newyork"
rs.Fields("Course") = "Anatomy"
rs.Fields("Status") = "Done"
rs.Update
rs.Close
Set rs = Nothing
db.Close
End Sub
Thank you in advance guys