J
Josh
I have a number of instances where I need to generate a
record in a second table after inserting into the main
table.
In the example here, I run this code after adding a new
record on form1. The RecordID is the PK in the current
form, and FK in Table2Log. RecordID is autoincrement in
table1. The backend is SQL server 2k. I cannot get it to
return the RecordID in form1 so it can be utlizied to
generate a record in table2Log.
How have others solved this issue?!
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenRecordset("Table2Log",
dbOpenDynaset, dbSeeChanges)
With Rst
.AddNew
!RecordID = Me.RecordID
.Update
.Close
End With
Thanks so much and happy new year!!
Josh
record in a second table after inserting into the main
table.
In the example here, I run this code after adding a new
record on form1. The RecordID is the PK in the current
form, and FK in Table2Log. RecordID is autoincrement in
table1. The backend is SQL server 2k. I cannot get it to
return the RecordID in form1 so it can be utlizied to
generate a record in table2Log.
How have others solved this issue?!
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenRecordset("Table2Log",
dbOpenDynaset, dbSeeChanges)
With Rst
.AddNew
!RecordID = Me.RecordID
.Update
.Close
End With
Thanks so much and happy new year!!
Josh