I have a main form called frmDemo with a subform frmStageTrack_S ub. On
the subform is a Combo Box CboTermID. The frmDemo is tied to tblDemo
and the frmStageTrack_S ub is tied to tblStageTrack. What I would like
to do is when a new record is created in frmDemo I would like to set
the CboTermID on the subform to a default value, say 1, without the
user having to set focus on the subform and selecting an item from the
combo box. Right now if the user does not select a TermID on the
subform no record is created in the StageTrack table when a new record
is created in frmDemo. I only wish to set a default value if the
TermID is Null.
I have tried the following in the AfterUpdate event of frmDemo
Private Sub Form_AfterUpdat e()
If IsNull(Me.Forms .frmDemo.frmSta geTrack_Sub.For m.CboTermID) Then
Forms.frmDemo.f romStageTrack_S ub.CboTermID = 1
End If
End Sub
But I keep getting a runtime error. What is the correct way to set the
CboTermID from the Main form?