I'm trying to open a child form as acReadOnly from a main form with link criteria. The child form has an OnOpen event that sets the Enabled property to true or false for controls on the child form. If I try to open the Child form as acReadOnly, and some of my controls used in the OnOpen event have null values, I get Run-time error 2427.
Is there a way to allow this form to open as read only with null values? I've posted my code for the OnOpen event. Any help would be greatly appreciated.
Is there a way to allow this form to open as read only with null values? I've posted my code for the OnOpen event. Any help would be greatly appreciated.
Code:
Private Sub Form_Open(Cancel As Integer)
If Me.AddSSMP.Value = 2 Or Me.ConSSMP.Value = 2 Then
Me.Reasons.Enabled = True
Me.CorrActions.Enabled = True
Else
Me.Reasons.Enabled = False
Me.CorrActions.Enabled = False
End If
If HWCmactX.Value = 1 Then
Me.HWinChamber.Enabled = True
Else
Me.HWinChamber.Enabled = False
End If
If HWinChamber.Value = 1 Then
Me.XceedStart.Enabled = True
Me.XceedStop.Enabled = True
Else
Me.XceedStart.Enabled = False
Me.XceedStop.Enabled = False
End If
End Sub