George-Bowyer
Registered User.
- Local time
- Today, 05:27
- Joined
- Dec 21, 2012
- Messages
- 178
After lots of googling, I found an answer that says that if (and only if) you are using an access BE as well as FE, you can get the ID of a newly created record by filling a variable before .update.
So I tried this code:
But unfortunately the "intNewID = !OrgPosID" line causes an overflow error.
I need the ID so that I can immediately create a linked record in another table.
Does anyone have any suggestions, please?
Many thanks.
George
So I tried this code:
Code:
.AddNew
!fldOrgPosOrg = 308
!fldOrgPosPerson = intPerson
!fldOrgPosPosition = 54
If Not IsNull(Me.txtStartDate) Then !fldStartDate = datDate
!fldDateChanged = Date
!fldChangedBy = Form_NavigationForm.cmbUser
intNewID = !OrgPosID
.Update
But unfortunately the "intNewID = !OrgPosID" line causes an overflow error.
I need the ID so that I can immediately create a linked record in another table.
Does anyone have any suggestions, please?
Many thanks.
George