[AccessD] Check for Null on a Subform

Hollis,Virginia HollisVJ at pgdp.usec.com
Wed Oct 22 16:26:26 CDT 2003


Before a form is closed I need to check for an entry in a certain field
(TypeTask) on a subform. How do I refer to the subform (frm_DDPSub) from a
close button on the main form (frm_DDPMain)?
 
I tried this code on the close button, but get an error - "Object does not
support this property or method". What am I doing wrong?
 
Virginia
 
*****************
  If IsNull(Forms!frm_DDPMain!frm_DDPSub.TypeTask) Then
            MsgBox "The type of task must be entered" & vbCrLf, vbCritical,
" Entry Required"
        DoCmd.CancelEvent
        Forms!frm_DDPMain!frm_DDPSub!TypeTask.SetFocus
                        
    Else
        DoCmd.RunCommand acCmdSaveRecord
        DoCmd.Close acForm, Me.Name
    End If


More information about the AccessD mailing list