Unanswered: How to check required property in code
I'm trying to customize error message that Access displays when required fields contain no data and set focus to the first empty control on the form with "required" set to true.
Here is my code:
Private Sub cmdSave_Click()
On Error GoTo cmdSave_Err
Select Case Err.Number
MsgBox "To create a new record fields ""RPA Number"", ""Division Number"", ""Date Sent to PSS"" must contain values", vbExclamation, _
"Data Entry Error"
Public Sub DataEntryError(frmActive As Form)
Dim recClone As Object
Dim ctr As Control
Set recClone = frmActive.RecordsetClone
For Each ctr In frmActive.Controls
If TypeOf ctr Is TextBox Or TypeOf ctr Is CheckBox _
Or TypeOf ctr Is ComboBox Then
If ctr.Required And IsNull(ctr.Value) Then
When I run this, the code stops at the red line with the mes.: Object doesn't support this property or method, #438
How can I check for the required property of a control in this case?
Thank you in advance.