thmsjlmnt3953
Registered User.
- Local time
- Today, 22:32
- Joined
- May 20, 2014
- Messages
- 120
I have the following in a class module (as it supports the me.controls format)
im trying to call it with the following
however im getting the above error - it works when ran inside the sub and not in a class but id like it in a module to use in every form.
Code:
Public Function CheckForm()
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox, acCheckBox
If Len(Nz(ctl.Value, vbNullString)) = 0 Then
With ctl
.BorderColor = vbRed ' Red
.BorderWidth = 1 ' 1 point
.BorderStyle = 1 ' Solid
End With
End If
End Select
Next ctl
MsgBox "Missing required information." & vbCrLf & "Please fill in all missing information and try again.", vbCritical, "Can't Save"
Exit Sub
End Function
im trying to call it with the following
Code:
Dim CheckTheForm As New clsCheckForm
CheckTheForm
however im getting the above error - it works when ran inside the sub and not in a class but id like it in a module to use in every form.