Spellcheck on a form Results

I got a database that we will be using to keep track of calls that come into the center. I got a notes field to write things down in.

Is there a way to ecorporate a spellcheck. I think I am trying to do too much with a program that wasnt ment for what they want me to do with it.

I suck at coding so visual is a little too much and out of my league.

Thanks guys/gals

I am fairly new to access and in particular VBA. So I've been working on setting up a spell checker for a specific memo field in a form using a button. Here is the code

Private Sub Spellcheck_click()

With Me!Description

If Len(.value) >0 Then
DoCmd.SetWarnings False
.Selstart = 1
.SelLength = Len(.Value)
DoCmd. RunCommand acCmdSpelling
. SelLength = 0
DoCmd.SetWarnings True

End If

End With

End Sub

I am looking at spelling checking two other field titled Comment (memo) and Title (textbox). When I switch the With Me!Description to With Me!Comment I receive a 438 Error. I've also tried to add a second with me statement using the "comment" or "title" instead of "description" but it doesn't work. This is frustrating!

Please help

Hi All,

I am using the following code (thanks ICEZEBRA) to spell check certain fields upon exit.

Private Sub YOURFIELDNAME_Exit(Cancel As Integer)
Dim strSpell
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub
End If
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub

This works great on the main form. However, when I try it on any of the sub-forms, it starts spell checking all of the fields. How do I get it to check only the fields I want when that field is on a sub-form?

It would be great to turn this into a public action in which you could just put "=spellchecker()" in the on exit event and it would do the rest. Thanks for the help.

I have no idea what is going on, but a form I have that has a spell checker button on it, seems to occasionally cause the attached error message ...(The expression on click you entered as the event property setting produced the following error: Object or class does not support the set of event....). After this happens no button on the form will work. This is happening on a pop up form that allows for users to enter details about an entry from a previous form. There are some text box's on this form which are populated from the previous form that I don't want spell checked or changed. I just want it to spell check the 4 memo box's which users are entering details about. I believe what is happening when spell check button is pressed it sometimes seems to try and check the auto populated at the top and not the memo box's and something gets crossed. It works for a while and then when the message occurs nothing will work, but going into design view and playing around somehow seems to fix it for a while and then a day later the same thing happens. I am not sure what to check as I don't know what or why this is happening. I am hoping someone can provide an answer. I hate it when things work sometimes.

The code I am using on this form is:
Code: Option Compare Database Option ExplicitPrivate Sub cmdNoteComplete_Click() Me.PNComplete = Now() DoCmd.Close End Sub Private Sub cmdNoteIncomplete_Click() Me.PNStarted = Now() DoCmd.Close End Sub Private Sub Command37_Click() DoCmd.RunCommand acCmdSpelling End Sub The code that I am using from my other form that brings this form up is as follows:
Code: Private Sub Command65_Click() Dim intID As Integer intID = Me.SessionID DoCmd.OpenForm "frmProgressNotes", , , "[DSLIDNumber]=" & [SessionID], , acDialog Me.Requery With Me.RecordsetClone .FindFirst "SessionID=" & intID Me.Bookmark = .Bookmark End With Attached Thumbnails   Reply With Quote 01-15-2013, 11:49 AM #2 June7 Super Moderator Windows XP Access 2010 32bit Join Date May 2011 Location The Great Land Posts 15,107 If you want to limit the spellcheck to those 4 controls and not the entire record, this suggests a method http://www.accessmonster.com/Uwe/For...ell-check-form

I have a number of forms where there are memo fields containing several paragraphs of text.

I have set them up so that the on-update event triggers the MSOffice spellcheck box/dialog to open so the text can be corrected.

All works fine but the box/dialog always opens in the middle of the screen and I would like it to open in a different position so that it doesnt cover the text being checked.

I have lots of popup forms where I have set the position on opening in VBA. Is there a way I can do this for the spellcheck box/dialog?

Thank you

I am using this code to perform spell checks (not sure where I got it, but it works a peach):

	Public Function SpellChecker(Calling As Form)
    On Error GoTo Err_SpellChecker
    Dim ctlSpell As Control
    Dim Incoming As String, Outgoing As String

    DoCmd.SetWarnings False

    Set ctlSpell = Calling.ActiveControl
    If (ctlSpell.Locked) Then
        Line1 = "Cannot spell check. Field is read-only"
        mbResult = MsgBox("OK", "", "", Line1)

        If (ctlSpell) > 0 Then
            Incoming = ctlSpell
            With ctlSpell
                .SelStart = 0
                .SelLength = Len(ctlSpell)
            End With
            DoCmd.RunCommand acCmdSpelling
            Outgoing = ctlSpell
        End If
        ' See if any changes were made 09/29/04
        If (Incoming  Outgoing) Then
            ' Notify user that changes
            ' were made, if you want to,
            ' or give Bronx cheer
        End If
    End If

    DoCmd.SetWarnings True

    Exit Function

    Select Case Err.Number
        Case 2424
            'MsgBox "change rs"
            Exit Function
        Case 438
            MsgBox "438 error"
        Case Else
            MsgBox Err.Number & "-" & Err.Description
            Resume exit_SpellChecker
    End Select
End Function


The textboxes that are spell checked reside on a subform that has it's recordsource dynamically created by an option group on the parent form (criteria in query changes by the value of the option group button selected).


If a textbox that has focus contains a misspelled word and the option group is clicked, ctlSpell does not exist and it throws a 2424 error. Strangely, I tested this in a textbox that contains properly spelled words and it works fine. No worries here but strange nonetheless.


Can I fire the spellcheck as part of the option group click event? So in effect the function could complete before the recordsource for the subform is changed. If this might work, how would I pass ctlSpell (the active control prior to clicking the option group) back to the function when the option group has already been clicked? Perhaps there is a better way but my limited knowledge of Access is tapped at the moment.

Thanks for looking and for providing any assistance you can.


I am new to this site and it has helped me many of times. I am an amature database designer and not that great with VBA coding but will need it to do what I need to do.

Basically what I want is to, use Microsoft Word as my editor in Access for Memo fields.

I have a form that is used to create an order for certain materials that we use but the rich text editor in access 07 doesnt have enough flexibility as I hoped, (e.g No Spellcheck for Runtimes versions and no check boxes) therefore I was thinking it might be possible that when I create an order and fill out the details of what i need and it comes to the actual 'body' (memo field) of the order it will open a blank word document or template (depending on the order selected) that I can then import into Access after it has been filled out.

Similarly, I would like the same thing for when a letter is created and to typoe the letter you use Word and then it imports it back to access.

Is this possible?

If you need more information please ask me as I would love for this to work somehow.

Thanks in advance.

I have a form that I am using to send emails to our maintenance department when a work order is written. I want my code to automatically spell check a field on the form before it sends the email. I have the call to the spellcheck function on the buttonclick event, but it does not allow it to complete the spellcheck before it actually sends the email. The code is as follows:

Private Sub cmdSend_Click()
If Not IsNull([Department]) Then
Call cmdSpellCheck (this opens the spellcheck box)
>>>>>>>>>>>>I need it to pause here before completing this code
Me![chkSpellCheck] = -1
Me![EmailSent] = -1
DoCmd.RunCommand acCmdSaveRecord
Call send_email
Dialog.Box "Your email has been sent.", vbOKOnly, "Message Sent"
DoCmd.GoToRecord , , acNewRec
Dialog.Box "You must enter a department.", vbOKOnly, "Missing Department"
End If
End Sub

Any ideas? Thanks.

I'm trying to make my database easy as possible for everyone to use while protecting against potential typos and the likes. I then had an idea and wanted to make sure if that was in line with accepted practices everywhere else. After all, just because you can do it, doesn't mean you should.

Would it be reasonable to have fields that would likely to have repeating data across various records to be a comboboxes. The fields I'm thinking of are City and ZIP code, which I would start with some more common ones, and allow users to add new ones while having the benefit of auto-expand as spell checker and reduce possiblity for bad data.

I'm not sure what ramifications that may have on forms beyond the fact that more lookup tables=slower database, especially over the network.

So would you want to make city or zip code or other similar fields combobox instead of a bound textbox?

Ok, I found this code on the internnet.

Private Sub CompanyName_AfterUpdate()
'If the textbox contains data run the
'Spell Checker after data is entered.
If Len(Me!CompanyName & "") > 0 Then
DoCmd.RunCommand acCmdSpelling
Exit Sub
End If
End Sub

now... he're the rub,
it works great doing a spell check of the fields that I tab through, but on my main form it will try and spell check the WHOLE TABLE.

How do I customize this to keep the spell check only to the record I have selected and not try to spellcheck 5000 enteries?

I want to use this for people who are inputing data into new fields, or editing fields of records. I have another button set up elseware for a full check.

Not finding an answer? Try a Google search.