L
Larry Kahm
My application has a combo box for City names. The client requested spell
check prior to adding a new value. She figures not many people are going to
get "Cincinnati" (sp?) correct no matter what.
So, I tried the following code on the cboCityID_NotInList event:
' Exit this subroutine if the combo box was cleared.
If NewData = "" Then Exit Sub
' Check the spelling
With Me.cboCityID
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
' DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
' DoCmd.SetWarnings True
' Set Response argument to indicate that new data is being added.
strSQL = "INSERT INTO tblCities([City]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Response = acDataErrAdded
And it seems that I can't get the spell check to run. Access generates the
following error:
"The spelling checker only works on text fields that contain text data
You're trying to check a field with a data type other than Text or Memo."
If anyone has any suggestions, I am willing to listen and learn.
Thanks!
Larry
check prior to adding a new value. She figures not many people are going to
get "Cincinnati" (sp?) correct no matter what.
So, I tried the following code on the cboCityID_NotInList event:
' Exit this subroutine if the combo box was cleared.
If NewData = "" Then Exit Sub
' Check the spelling
With Me.cboCityID
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
' DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
' DoCmd.SetWarnings True
' Set Response argument to indicate that new data is being added.
strSQL = "INSERT INTO tblCities([City]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Response = acDataErrAdded
And it seems that I can't get the spell check to run. Access generates the
following error:
"The spelling checker only works on text fields that contain text data
You're trying to check a field with a data type other than Text or Memo."
If anyone has any suggestions, I am willing to listen and learn.
Thanks!
Larry