I have a main form with a continuous form as the source object in the subform control. There's a button on the continuous subform that changes the subform source object to a single form but when the subform source object is changed, it always goes to the first record in the single form. I want the single subform to show the record with the same ID as the record in the continuous form. I have tried:
Forms![Main Form]![Subform].Form.SourceObject = "singleSubForm"
Forms![Main Form]![Subform].Form.Filter = "[ID]=" & Me![ID]
Forms![Main Form]![Subform].Form.FilterOn = true
Forms![Main Form]![Subform].Form.SourceObject = "singleSubForm"
With Forms![Main Form]![Subform].Form.Recordset
.FindFirst "ID=" & Me![ID]
End With
Forms![Main Form]![SubForm].Form.SourceObject = "singleSubForm"
Forms![Main Form]![Subform].Form.RecordSource = "SELECT * FROM Query1 WHERE [ID] =" & Me![ID]
How can I make it so that when I click on the button in the record in continuous subform, the subform source object changes to a single form and goes to the record with the same ID as the record in the continuous form where the user pressed the button?