.AddNew and have field entered as variable

mcgraw

Registered User.
Local time
Today, 08:32
Joined
Nov 13, 2009
Messages
77
I'd like to know if it is possible to add a new record, and then take the ID (PK) of the new record, and have it stored as a variable for use in a different area.

So, if I do:

Code:
Private Sub form_AfterUpdate()
 
Set rs = CurrentDb.OpenRecordset("tblWithGroup")
 
.AddNew
!Issue_ID = me.ID
!Old_Group = OldGroup
!Group = me.with_group
!Start_Date = Date
.Update
 
Dim GID As String
[B]GID = tblwithgroup.ID[/B]
 
Set rs = CurrentDB.OpenRecordset("Issues")
.Edit
group_ID = GID
.Update

How do I set GID = the ID of the tblWithGroup of the record just created?
 

Users who are viewing this thread

Back
Top Bottom