Results 1 to 14 of 14
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spell Check on controls (AXP)

    I know there is a way, but it the right way that I am after!

    How can I do a spell check on a form control? Also, are there any options one can due during the spell check, like auto replace, suggest replacement, etc?

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    Interactively, press F7 or select Tools | Spellling... while the insertion point is in a control that contains text. You can set various options in the Spelling tab of Tools | Options...

    You can invoke the spell checker in code using RunCommand acCmdSpelling. It is wise to add error handling in case spell checking is not possible.

    Note: a combo box may display text, but still be bound to a numeric field; it doesn't count as text then!

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    Great! Is there a way to make it so that it only runs on the control in question? It seems that it wants to run on everything that is open.

    Thanks,
    Mark

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    You could create a command button cmdSpell with the following On Click code:

    Private Sub cmdSpell_Click()
    On Errror GoTo ErrHandler
    With Screen.PreviousControl
    .SetFocus
    .SelStart = 0
    .SelLength = Len(.Text)
    End With
    RunCommand acCmdSpelling
    Exit Sub
    ErrHandler:
    ' Just get out
    End Sub

    By selecting the text within the control, you limit spell checking to that control

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    That will work!

    Thanks Hans!

  6. #6
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    This works great. However, is there a way to make it work silently in the background? When it runs, it gives a dialog that says it has completed running. I would like for the user not to have to make another click if I can avoid it.

    Thanks,
    Mark

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    Short of buying a third-party spell checker add-in (such as Total Access Speller from FMS, website seems to be down at the moment) or writing your own spell checking routines <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>, I don't think that is possible.

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    I've just found out that pressing F7 doesn't work if you open the mdb using the 2003 RunTime. Is there a workaround?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    The runtime version of Access does not include proofing tools.

    If the PC with the runtime version does have Microsoft Word installed, you could use code to load an invisible instance of Word and let it perform the spell check. That obviously won't work on PCs that don't have MS Office at all.

  10. #10
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    Thank you Hans, can you provide an example of such code?

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    Sorry, I haven't tried this myself (I don't use Access Runtime).

  12. #12
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    I've made it work by putting a Spell Check command button on the main form whose code first sets the focus on the continuous subform and then runs the spell check but I can't figure out how to give the focus back to the main form once the spell check is done so that the upper part of the main form window comes back into view.
    Attached Files Attached Files

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Spell Check on controls (AXP)

    You have to set focus to a control in the main form, e.g.

    Me.CmbDaEvadere.SetFocus

  14. #14
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check on controls (AXP)

    Thank you Hans, I've added a transparent text box to the top left of the main form.

Posting Permissions

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