Sounds like you want to display all the records on one tab and use tab1 to navigate tab2. You could easily do this using a Combobox on your form (vice tabs). The combobox could display 1 or more fields in a droplist. Make sure your "ID" is in the bound column (defaults to column 1). Code would look similar to this:
-
Private Sub cboMyCombo_AfterUpdate()
-
DoCmd.GoToControl "txtRecordID" 'The control with the ID in it
-
DoCmd.FindRecord Me.cboMyCombo, , False, , False, , True
-
End Sub
-
You can use pretty much the same code for what you are trying to do.
But gets a little tougher. In a module declare your variable: Public varID as Variant. That way its not form specific.
-
Private SubMySubForm_DblClick(Cancel As Integer)
-
varID = Me.txtID 'Name of control on subform with ID field assigned to it
-
DoCmd.GoToControl "txtRecordID" 'The control with the ID in it - the single records
-
DoCmd.FindRecord varID, , False, , False, , True
-
End Sub
-
I have used a list similar to you on a project - when user double-clicked on a record it opened the selected record in its own form as a dialog box. When user finished edit and closed dialog they could navigate to next record or quit app.