Results 1 to 2 of 2

Thread: Spell checking

  1. #1
    Join Date
    Dec 2002

    Unanswered: Spell checking

    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
    With Me!sprComments
    .SelStart = 0
    .SelLength = Len(Me!sprComments)
    End With
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdSpelling
    DoCmd.SetWarnings True
    End If

    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?

  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    I can get different errors...

    virgin database
    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)
    --works fine

    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"
    [cancel] spellcheck
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts