After digging around here and modifying some of the code I found, I wrote this simple little function to auto capitalize all of the fields on a form. It's pretty simple and I am sure that it has already been done but I thought it might help someone else out that is trying to do the same thing. All you need to do is put the following code in the BeforeUpdate event for your form.
Hopefully this will help someone at some point that needs for all fields to be capitals
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Form_BeforeUpdate_Err
Dim I As Integer
For I = 0 To (Me.Controls.Count - 1)
Me.Controls.Item(I).Value = UCase(Me.Controls.Item(I).Value)
Next
Form_BeforeUpdate_Exit:
Exit Sub
Form_BeforeUpdate_Err:
If Err.Number = 438 Or Err.Number = 2448 Then
Resume Next
End If
MsgBox Err.Description, , "#" & Err.Number
Resume Form_BeforeUpdate_Exit
Resume
End Sub
Hopefully this will help someone at some point that needs for all fields to be capitals
Last edited: