Results 1 to 6 of 6
  1. #1
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40

    Can you set spell check to check just 1 textbox on a form?

    I am running the following code on a textbox.LostFocus.
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdSpelling
    DoCmd.SetWarnings True
    It works ok but it also checks other textboxes too. Is there an easy way to tell spell che
    ck to only check the text box the is losing focus?



    Dave

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    try putting the code in the control exit event and you probably need to select the text to be spell checked - something like

    Code:
    Private Sub txtControl_Exit(Cancel As Integer)
    
        txtControl.SetFocus
        If Len(txtControl) > 0 Then
            txtControl.SelStart = 1
            txtControl.SelLength = Len(txtControl)
            DoCmd.RunCommand acCmdSpelling
            txtControl.SelLength = 0
        End If
    
    End Sub
    not tested and change txtControl to the name of your control

  3. #3
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40
    Ajax
    I'm sorry to say that it will test the Textbox that I call out but The real problem is that it doesn't stop there. It goes on to test
    most of the other textboxes too.

    But the real problem I'm having is that when the spell check box is done the only option is "CLOSE" and when that happen it saves the current form whether I'm done or not and moves on to the next record. And there is nothing I can do about it.

    dave

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I don't use the spell checker so regret cannot suggest anything else

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    I think we need to see the exact code you've tried...as

    • For me, the code given only checks the target Control...no other Controls, as at this point no other Controls are selected

    • I have no idea where 'when the spell check box is done the only option is "CLOSE"' comes from! 'Only option' from where? It's certainly not an option of the SpellChecker.

    Even better than the exact code would be letting us see the file itself...having removed any sensitive data...compacted it...and ZIP it up and attach it to a post. As I suggested, the 'close' option has to be coming from elsewhere in the form.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    IamKJVonly is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2018
    Posts
    40
    I thought I posted this last night but obvious that I didn't.
    I cleaned out ALL my code for the from and reinstalled the code and everything work.
    I don't know why. It must have been bad coding on my part somewhere but I couldn't find it.

    Here is the code that works.
    If Len(F_MyComments) > 0 Then
    F_MyComments.SelStart = 1
    F_MyComments.SelLength = Len(F_MyComments)
    DoCmd.SetWarnings False
    DoCmd.RunCommand acCmdSpelling
    DoCmd.SetWarnings True
    End If

    I want to thank everyone for helping me because my spelling is horrible.
    This is really nice form for me because I feel at home here and feel free to ask dumb questions.
    Thanks for putting up with me.
    Dave

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

Similar Threads

  1. Auto Spell Check in Form Field
    By Njliven in forum Forms
    Replies: 7
    Last Post: 04-26-2017, 07:44 AM
  2. Replies: 5
    Last Post: 11-07-2016, 11:05 AM
  3. Replies: 12
    Last Post: 01-27-2016, 12:23 PM
  4. Replies: 1
    Last Post: 05-12-2014, 07:42 AM
  5. Spell and grammar check
    By destroyer in forum Forms
    Replies: 1
    Last Post: 01-19-2014, 11:51 AM

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