Solved it
The subform is on a Tab control.
The OnCurrent of the main form or on changing tabs I call this StayOnTab
routine (abbreviated)
Sub StayOnTab()
Dim i As Integer
On Error GoTo StayOntab_Err
If TabCtl118 = 1 Then ' Dividends
DoCmd.GoToControl "subDividends"
DoCmd.GoToRecord , , acLast
For i = 1 To 15
DoCmd.GoToRecord , , acPrevious
Next i
DoCmd.GoToRecord , , acNewRec
End If
Exit Sub
StayOntab_Err:
If Err = 2105 Then ' You can't go to the specified record
Resume Next
Else
MsgBox "Error" & Err & " " & Err.Description
End If
End Sub
Thanks anyway
Phil