Spell Check Fields in Forms

Virtucom

New member
Local time
Yesterday, 20:40
Joined
Apr 16, 2009
Messages
3
Hello - this is a great forum as I have obtained many useful event procedure codes to enhance our access based content management system. I am hoping that somebody can help me out to streamline the below code for what I'm trying to accomplish.

I am trying to force our copywriters into using a spell-check when they exit specific form based fields. I have obtained the below code on a forum on here and it is working.

The problem is that our form has numerous fields (title, short description, features and product type specific attributes). Using the code below it auto-runs the spell check when i click out of the field I specified, but this code will not allow me to click into another field to proceed with data entry after the fact.

Ideally I want to have the auto spell check launch for each field in the form after they populate the content and click out to enter the next field in the form. Any help that can be provided would be very much appreciated.

Private Sub YOURFIELDNAME_Exit(Cancel As Integer)
Dim strSpell
strSpell = YOURFIELDNAME
If IsNull(Len(strSpell)) Or Len(strSpell) = 0 Then
Exit Sub


End If
With YOURFIELDNAME
.SetFocus
.SelStart = 0
.SelLength = Len(strSpell)
End With
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True
End Sub



 
Hi Uncle Gizmo -

Thanks for the response. I think what you are providing would do the job but I can't get it to function properly. When I try to open your example database I get an access message that it can not open the file because it's located outside of my intranet, which is strange because I unzipped it to my desktop.

In any rate tell me if this sounds correct. I created a new form and added a textbox named MyZoomBox. Then with it selected, I went to Properties - Data and set its Control Source to the same field as the original textbox. This is where I might be getting lost. Exactly where and how do I enter the following code?

Private Sub Form_Current()
'Closes the zoombox in case you leave the last record without doing so
MyZoomBox.Visible = False
End Sub

I think the rest is pretty self explanitory, but if you could explain more indepth it would be helpful. Maybe I need to create the new MyZoomBox text box in the existing form as hidden?
 

Users who are viewing this thread

Back
Top Bottom