B
breeboud
I have the following code on a Save button where I attempt to require data
entry in both of the subforms. However, when I run it it gives me a compile
error: method or data member not found on the "Form" portion of the first If
statement. Not sure why....
Private Sub Save_Click()
Dim OKToSave As Boolean
OKToSave = True
On Error GoTo Err_Save_Click
If Me.frmWorkOrderFunctionCodes.Form.RecordsetClone.RecordCount = 0
Then
MsgBox "Please Enter Relevant Function Codes"
OKToSave = False
End If
On Error GoTo Err_Save_Click
If Me.frmPartInfo.Form.RecordsetClone.RecordCount = 0 Then
MsgBox "Please Enter Part Info"
OKToSave = False
End If
If OKToSave Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub
entry in both of the subforms. However, when I run it it gives me a compile
error: method or data member not found on the "Form" portion of the first If
statement. Not sure why....
Private Sub Save_Click()
Dim OKToSave As Boolean
OKToSave = True
On Error GoTo Err_Save_Click
If Me.frmWorkOrderFunctionCodes.Form.RecordsetClone.RecordCount = 0
Then
MsgBox "Please Enter Relevant Function Codes"
OKToSave = False
End If
On Error GoTo Err_Save_Click
If Me.frmPartInfo.Form.RecordsetClone.RecordCount = 0 Then
MsgBox "Please Enter Part Info"
OKToSave = False
End If
If OKToSave Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub