DoCmd.GoToRecord acDataForm, "frmListForm", acNewRec
With Forms!frmListForm .Recordset.AddNew !SomeField = NewData End With
without any ambiguity.
DoCmd.OpenForm "frmListForm" With Forms!frmListForm!SubformName.Form .Recordset.AddNew !SomeField = NewData End With
If they responded <Yes> then I called a SQL-Server Stored Procedure to insert a new record into Table-B with the value they have already keyed.
Dim rst As ADODB.Recordset Set rst = Forms!YourForm.RecordsetClone rst.Find "PKID = " & lngYourNewID If Not rst.EOF Then Me.Bookmark = rst.Bookmark End If
I stepped through the records until I reached the one that matched the newly created record "code"You've moved through the form's entire recordset one record at a time until you find the match? That's certainly surprising.
My Table-B does not have an incremental id, merely an nvarchar(20) "code" field as the primary key.
The Table-B records are displayed in Form-B in "code" order.
The "docmd.gotorecord" option sounds worth trying.
Where would I make that call? In Form_Load (or somewhere?) inside Form-B, or from Form-A after I have opened Form-B?
Thanks in advance for your further help.