Results 1 to 7 of 7
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Spellchecker function that selects only the control you are using

    I have a function that checks the spelling of the text entered (when using afterupdate event)

    however the spell checker continues on to check other text box controls! text fields that are locked and do not require checking.



    how do I prevent this?

    the code below

    Code:
    'spell check a formfield
    Public Sub SpellChecker(TextField As Control)
        
        With TextField
            .SetFocus
            .SelStart = 1
            .SelLength = Len(.Text)
            DoCmd.SetWarnings False
            .SelLength = 0
            DoCmd.RunCommand acCmdSpelling
            DoCmd.SetWarnings True
            .SetFocus
        End With
    
    
    
    
    End Sub

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    just stick the code into the private sub of the AfterUpdate event itself rather than call it from a module...is definitely one way to go about it.....

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by NTC View Post
    just stick the code into the private sub of the AfterUpdate event itself rather than call it from a module...is definitely one way to go about it.....

    nope (it's what I had first before I turned it into a function anyway) - hasn't solved the issue

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    hmmm well sorry for the bad advice...the culprit I presume is:
    DoCmd.RunCommand acCmdSpelling

    are there any parameters able to be strung along to lasso it down an individual control? I only ask as I see no commas trailing where options can be included......it's not a method I use so one would have to inspect what other properties may be in this acCmdSpelling definition/method.....

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by NTC View Post
    hmmm well sorry for the bad advice...the culprit I presume is:
    DoCmd.RunCommand acCmdSpelling

    are there any parameters able to be strung along to lasso it down an individual control? I only ask as I see no commas trailing where options can be included......it's not a method I use so one would have to inspect what other properties may be in this acCmdSpelling definition/method.....
    Yeah as far as I can tell I believe docmd.runcomman accmdspelling runs on the form rather than the single control - which isn't much use and I can't edit or get more options/methods etc.

    If I could utilise a dictionary file, the same one that the MS office spelling checker uses - I suppose I could write a form that functions as a spell checker.. but that is a heck of a lot of work!!.

  6. #6
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    guess you have to do something weird to make that field to be in its own table and then inset that field as a sub field.... or trigger an unseen form of just that table and run it there but display the result....

  7. #7
    ISM is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    4
    Hi- Read your thread and remembered I was trying to do this at some point awhile ago. I still had a link that helped me and maybe it can help you.

    http://www.eileenslounge.com/viewtopic.php?f=29&t=10183

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 03-18-2014, 07:02 PM
  2. Replies: 10
    Last Post: 12-27-2013, 02:54 PM
  3. 4 Selects, 1 Union
    By Perceptus in forum Queries
    Replies: 6
    Last Post: 12-27-2012, 03:46 PM
  4. Chain Selects
    By cff_moiseszaragoza in forum Access
    Replies: 2
    Last Post: 10-27-2011, 09:41 AM
  5. set focus selects all of the text
    By markjkubicki in forum Forms
    Replies: 3
    Last Post: 05-19-2011, 12:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums