[AccessD] Setting Start Form using code

Michael R Mattys michael.mattys at adelphia.net
Fri Oct 24 12:42:55 CDT 2003


Alun,

>From looking up GetOption in (not much) Help
you can get to this page from the link:
Set Options from Visual Basic

I can't get back to where I found this example,
but here it is ...

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
    ChangeProperty "StartupForm", DB_Text, "Customers"
    ChangeProperty "StartupShowDBWindow", DB_Boolean, False
    ChangeProperty "StartupShowStatusBar", DB_Boolean, False
    ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
    ChangeProperty "AllowFullMenus", DB_Boolean, True
    ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
    ChangeProperty "AllowSpecialKeys", DB_Boolean, True
    ChangeProperty "AllowBypassKey", DB_Boolean, True
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
    Dim dbs As Object, prp As Variant
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then    ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, _
            varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function
Michael R. Mattys
Try MattysMapLib for MapPoint at
www.mattysconsulting.com



----- Original Message -----
From: "Garraway, Alun" <Alun.Garraway at otto.de>
To: "Access DatabaseAdvisors (E-Mail)" <accessd at databaseadvisors.com>
Sent: Friday, October 24, 2003 1:12 PM
Subject: [AccessD] Setting Start Form using code


> hallo List :-)
>
> in a db I use the start option of having a form open when the db is
opened.
>
> is it possible to change this using code?
>
> tia
>
> alun
> _______________________________________________
> 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