hi,
i have a form where an SQL Insert query is running to append Table1 with a new row. Just afterwards, I would like to update a corresponding record in Table2 with the primary key field of the 'just inserrted' row in Table 1.
I know that I need to use an SQL Update query and know how to reference the WHERE field as you can see below...what i dunno is how to identify the last record primary key field ...
DoCmd.RunSQL _
"UPDATE Bookings" & _
" SET [DespRef] = " & ??? what ??? & _
", [Status] = 20" & _
" WHERE [BookingRef] = " & Forms!xCreate_Despatch1("BookingRef" & k) & ";"
Any ideas?
i have a form where an SQL Insert query is running to append Table1 with a new row. Just afterwards, I would like to update a corresponding record in Table2 with the primary key field of the 'just inserrted' row in Table 1.
I know that I need to use an SQL Update query and know how to reference the WHERE field as you can see below...what i dunno is how to identify the last record primary key field ...
DoCmd.RunSQL _
"UPDATE Bookings" & _
" SET [DespRef] = " & ??? what ??? & _
", [Status] = 20" & _
" WHERE [BookingRef] = " & Forms!xCreate_Despatch1("BookingRef" & k) & ";"
Any ideas?