I have a subform (sfmIncidentDetailsUpdates) with a field (TextDetails) with the following code in the on exit event:
Private Sub TextDetails_Exit(Cancel As Integer)
Dim strSpell
strSpell = Forms![IncidentForm]![sfmIncidentDetailsUpdates].Form![TextDetails]
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With Forms![IncidentForm]![sfmIncidentDetailsUpdates].Form![TextDetails]
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings Fals
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
Form.SetFocus
End Sub
This works in the sense that it checks the spelling this field only on exit. However, when you move between records on the main form it checks all of the fields on the subform, not just this one.
Have I referenced the field incorrectly? Is there a way to tell it to ignore the other fields on the subform?
Interestingly, I use this same code on the main form and it works without problem.
Sorry that this is a repost. However, I better defined the problem. Thanks
Private Sub TextDetails_Exit(Cancel As Integer)
Dim strSpell
strSpell = Forms![IncidentForm]![sfmIncidentDetailsUpdates].Form![TextDetails]
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
With Forms![IncidentForm]![sfmIncidentDetailsUpdates].Form![TextDetails]
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings Fals
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
Form.SetFocus
End Sub
This works in the sense that it checks the spelling this field only on exit. However, when you move between records on the main form it checks all of the fields on the subform, not just this one.
Have I referenced the field incorrectly? Is there a way to tell it to ignore the other fields on the subform?
Interestingly, I use this same code on the main form and it works without problem.
Sorry that this is a repost. However, I better defined the problem. Thanks