icemonster
Registered User.
- Local time
- Today, 08:07
- Joined
- Jan 30, 2010
- Messages
- 502
so this code works fine, even with a sharepoint list table, yet am having extreme, and no success with mysql, any ideas how to capture the autonumber/primary key when using .addnew?
P.S this is a testing code
Code:
Set rs = CurrentDb.OpenRecordset("qry_employee")
rs.AddNew
rs.Fields("EMP_LASTNAME").Value = Me.txtLastName
rs.Fields("EMP_FIRSTNAME").Value = Me.txtFirstName
rs.Update
rs.Bookmark = rs.LastModified
lngPatientID1 = rs!ID_EMPLOYEE
rs.Close
Set rs = Nothing
lngPatientID2 = lngPatientID1
Set rs = CurrentDb.OpenRecordset("qry_employee_education")
rs.AddNew
rs.Fields("EMPED_ID_EMPLOYEE").Value = lngPatientID2
rs.Fields("EMPED_NAME_OF_SCHOOL").Value = Me.txtNameofSchool
rs.Fields("EMPED_SCHOOL_ZIPCODE").Value = Me.txtSchoolZipCode
rs.Update
rs.Close
Set rs = Nothing
End Sub
P.S this is a testing code