I am trying to spell check a text box on a bound form. I am using the following code in the AfterUpdate event procedure:
If Len(Me!sprComments & "") > 0 Then
.SelStart = 0
.SelLength = Len(Me!sprComments)
I am recieving this error: "Update or cancel update without addnew or edit"
Can anyone shed some light as to what this error is and how to fix it?
add table of one text field with a single record containing "hookmakers"
add bound form
used your code except setwarnings and fixed-length select of 10 chars
change the word "hookmakers" -> "bookmakers" (passes spell check)
change the word "bookmakers" -> "hookmakers" (fails spelling check)
[ignore] --works fine
[change] (back to "bookmakers") --error:
"the macro or function set to the beforeupdate or validationrule property for this field is preventing microsoft access from saving the data in the field"
"an error occurred while trying to modify the contents of field myText. the field may be locked or read only or you may not have permissions..."
myText is now the change text "bookmakers"
myText is now the pre-change text "hookmakers"
so: spell check launches correctly, but access wont let it make corrections. that's useful!
one suggestion is to hide the bound box and copy the content to an unbound box for the user to play with. use lost focus to spell check the unbound box and then copy to the bound box. maybe it's better this way: spell checking AFTERupdate is rather late.