Hi all,
I have function name mdValidateData to validate data in my subform which is
on Navigation Control - Page Index 0
On Main form I have the following codes:
I have closeButton (on Main form) with code:
I have Navigation form with 5 pages. The first page (with Index 0) where is my subform fm_PSD. I need to prevent clicking on other pages if cboInspection on fm_PSD (subform on PageIndex 0) is Null
What I need to do?
I have function name mdValidateData to validate data in my subform which is
on Navigation Control - Page Index 0
On Main form I have the following codes:
Code:
Private Sub Form_Load()
'Add controls in order
ctls.Add Me![fm_PSD]![cboInspection]
End Sub
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not DataValid2(Me, ctls) Then
Cancel = True
End If
End Sub
Code:
Private Sub closeButton_Click()
Dim rtn As Long
If DataValid2(Me, ctls) Then
DoCmd.Close acForm, Me.Name
Else
rtn = MsgBox(" Select OK to Close without saving, or CANCEL to complete form.", vbOKCancel, "Validate Data")
If rtn = vbOK Then
DoCmd.Close acForm, Me.Name
End If
End If
End Sub
What I need to do?