Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Sub SetStartForm()
Dim dbs As Object
Dim prp As Object
Const PROPERTY_NOT_FOUND As Integer = 3270
Const TEXT_TYPE As Integer = 10
' Equivalent to DAO dbText data type.
On Error GoTo ErrorHandler
Set dbs = Application.CurrentDb
' Try to set the property. If it fails, the property does not exist.
dbs.Properties("StartupForm") = "frmForm"
ExitLine:
dbs.Close
Set dbs = Nothing
Set prp = Nothing
Exit Sub
ErrorHandler:
If Err.Number = PROPERTY_NOT_FOUND Then
' Create the new property.
Set prp = dbs.CreateProperty("StartupForm", TEXT_TYPE, "frmForm")
dbs.Properties.Append prp
Resume Next
Else
Resume ExitLine
End If
End Sub