ClaraBarton
Registered User.
- Local time
- Yesterday, 20:05
- Joined
- Oct 14, 2019
- Messages
- 605
The following code gets a new Contact ID, and preloads a new record but the form does not move to the new record.
Where I am I going wrong?
Code:
Public Sub AddRecord()
On Error GoTo Error_Handler
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim frm As Form
Dim strLinkCriteria
Set db = CurrentDb()
strLinkCriteria = "[ContactsID]=" & NewContactID()
'reposition form to new record
Set rst = Me.RecordsetClone
If Me.RecordsetClone.RecordCount > 0 Then
rst.FindFirst strLinkCriteria
If Not rst.EOF Then
Me.Bookmark = rst.Bookmark
End If
End If
rst.Close
Set rst = Nothing
Me.FirstName.SetFocus