Hello,
I am new to access and am currently making a data base where I have a button on a on the main form header which when clicked calls a function in a module to spell check a specific field in a subform. The code when highlights the text as it should however the DoCmd.RunCommand acCmdSpelling doesnt seem to actually check the spelling? Please see the code below. Any help would be great!
Public Function FUNC_SpellCheck()
On Error Resume Next
Dim ctlSpell As Control
Set ctlSpell = [Forms]![MainForm]![SubForm1]![Subform2].[Form]![TextField]
If TypeOf ctlSpell Is TextBox Then
If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
ctlSpell.SetFocus
Exit Function
End If
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
DoCmd.RunCommand acCmdSpelling
End With
End If
End Function
I am new to access and am currently making a data base where I have a button on a on the main form header which when clicked calls a function in a module to spell check a specific field in a subform. The code when highlights the text as it should however the DoCmd.RunCommand acCmdSpelling doesnt seem to actually check the spelling? Please see the code below. Any help would be great!
Public Function FUNC_SpellCheck()
On Error Resume Next
Dim ctlSpell As Control
Set ctlSpell = [Forms]![MainForm]![SubForm1]![Subform2].[Form]![TextField]
If TypeOf ctlSpell Is TextBox Then
If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
ctlSpell.SetFocus
Exit Function
End If
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
DoCmd.RunCommand acCmdSpelling
End With
End If
End Function