[AccessD] Form Header/Footer - adding by code

Michael R Mattys michael.mattys at adelphia.net
Sun Feb 9 09:47:01 CST 2003


Hi Bruce

Sub NewForm()
    On Error GoTo NewForm_Error
    Dim frm As Form

    ' Create form based on Customers form.
    Set frm = CreateForm(, "zzNewForm")
    DoCmd.Restore
    With frm
        If frm.Section(1) = True Then
            'test existance
        End If
    End With
    Set frm = Nothing
    Exit Sub
NewForm_Error:
    If Err.Number = 2462 Then
        DoCmd.RunCommand acCmdFormHdrFtr
    End If
End Sub

Mike Mattys

----- Original Message -----
From: "Bruce Bruen" <bbruen at bigpond.com>
To: "AccessD" <accessd at databaseadvisors.com>
Sent: Sunday, February 09, 2003 5:59 AM
Subject: [AccessD] Form Header/Footer - adding by code


> I have a bunch of forms that I need to standardise.  Some have headers,
some
> don't.
>
> Is there any way to test if the form header section exists via code and if
> not then make it exist?
>
> I have tried looping through the form.section(x)'s, testing the visible
> property but it fails as soon as the header doesn't exist.
>
> But even if I can test it, I cant see how to make it exist via code?
>
> tia
> Bruce
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list