In one subform, the following code is part of the OnCurrent sub and makes another subform update. It works fine all the time, except when the first subform is sorted by hitting 'A-Z' and then I select a record that has subordinate data that would be displayed in the second subform, but not when I select a record that has no subordinate data.
How is it possible to get this error on line in red text...
[tab][blue]Run-time error '2110':
[tab]..can't move the focus to the control subfrmYearList[/blue]
...from this code...
[tab][blue]MsgBox "Just Before: " & DCount[tab]("ID", "qryYearsList")
[tab] If DCount("ID", "qryYearsList") <> 0 Then
[tab] MsgBox "Inside: " & DCount[tab]("ID", "qryYearsList")
[tab] Me.Parent![tab]subfrmYearList.SetFocus
[tab] DoCmd.GoToRecord , , acFirst
[tab] Me.Parent!subfrmSubWatershedList.SetFocus
[tab] End If[/blue]
...when first msgBox shows: 'Just Before: 0', and
second msgBox does not show?
Daniel Dillon
O o . (<--- brain shrinking at rate shown.)
How is it possible to get this error on line in red text...
[tab][blue]Run-time error '2110':
[tab]..can't move the focus to the control subfrmYearList[/blue]
...from this code...
[tab][blue]MsgBox "Just Before: " & DCount[tab]("ID", "qryYearsList")
[tab] If DCount("ID", "qryYearsList") <> 0 Then
[tab] MsgBox "Inside: " & DCount[tab]("ID", "qryYearsList")
[tab] Me.Parent![tab]subfrmYearList.SetFocus
[tab] DoCmd.GoToRecord , , acFirst
[tab] Me.Parent!subfrmSubWatershedList.SetFocus
[tab] End If[/blue]
...when first msgBox shows: 'Just Before: 0', and
second msgBox does not show?
Daniel Dillon
O o . (<--- brain shrinking at rate shown.)