From Main form, check for new record in subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

From the main form, I want to check if there is a new record in a subform.
I get the following error message: "Object doesn't support this property or
method". I'm using the following code:

Private Sub Add_Record_Click()
Dim intnewrec As Integer
intnewrec = Forms![Name of Main Form]![Name of Subform].NewRecord
If intnewrec = True Then
MsgBox "You're at the new record in the subform." _
End If
End Sub
 
Add the .Form bit to refer to the form in the subform control:
If Me![Name of Subform].Form.NewRecord Then
 
Back
Top