|
|
This function loops through each control of each form in the current database and sets the controls' AllowAutocorrect property to False (default is True). This is useful if you do not wish any autocorrect functionality in any of your forms. The function can be easily enough adapted to take an exception list or to work on a form-specific basis rather than on the AllForms collection. Add error handling as required. CODE Public Function SetAllAutoCorrectsOff() As Boolean Dim frm As Form Dim ctl As Control Dim i As Integer 'make sure all forms are closed If Forms.Count <> 0 Then For i = 0 To Forms.Count - 1 DoCmd.Close acForm, Forms(i).Name, acSaveYes Next End If For i = 0 To CurrentProject.AllForms.Count - 1 DoCmd.OpenForm CurrentProject.AllForms(i).Name, acDesign For Each ctl In Forms(CurrentProject.AllForms(i).Name).Controls 'if it's a control or textbox set the autocorrect property to false If (ctl.ControlType = acTextBox) Or (ctl.ControlType = acComboBox) Then ctl.AllowAutoCorrect = False End If Next ctl DoCmd.Close acForm, CurrentProject.AllForms(i).Name, acSaveYes Next i End Function
|
| This page was last modified 02:32, 21 May 2011. This page has been accessed 254 times. Disclaimers |