Private Sub cmdSpellCheck_Click() Dim i As Integer 'Turning off warnings to prevent completion message after each control ' is checked DoCmd.SetWarnings False 'Loop through each control on the form For i = 0 To Me.Count - 1 'Check to see if the control is a textbox If TypeOf Me(i) Is TextBox Then 'Verify that focus is set to the control Me(i).SetFocus 'Select starting point and select the contents of the control Me(i).SelStart = 0 'Verify that the control contains data and select the contents If Len(Me(i)) > 0 Then Me(i).SelLength = Len(Me(i)) 'Run the Spell Checker on the contents of the control RunCommand acCmdSpelling End If End If Next i 'Tell user that the check is complete for this record. MsgBox "Spell Check is Complete" 'Turning warnings back on DoCmd.SetWarnings True End Sub
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: