Solved Display Form Option (1 Viewer)

LarryE

Active member
Local time
Today, 03:12
Joined
Aug 18, 2021
Messages
592
Does anyone know how to reference the Display Form option in VBA?
I thought Application.GetOption("Display Form") might work, like other options, but I get an error " 'Display Form' is an invalid name". I get the same with
Application.GetOption("DisplayForm").

I need to re-open whatever the default Display Form is using VBA sort of like this:

Dim DisplayForm As String
DisplayForm=Application.GetOption("Display Form")
DoCmd.OpenForm DisplayForm
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:12
Joined
Sep 21, 2011
Messages
14,319
No clue :(

So tried looking to see what a DB has as properties
Seems it is called StartUpForm ?

Run this on your DB to double check
Code:
Sub dbProperties()
Dim prp As DAO.Property
Dim db As DAO.Database
On Error Resume Next

Set db = CurrentDb()
For Each prp In db.Properties
    Debug.Print prp.Name & " - " & prp.Value
Next
Set db = Nothing
End Sub

Output
Name - C:\Users\Paul\Documents\Test.accdb
Connect -
Transactions - True
Updatable - True
CollatingOrder - 1033
QueryTimeout - 60
Version - 12.0
RecordsAffected - 0
ReplicaID -
DesignMasterID -
ANSI Query Mode - 0
Themed Form Controls - 1
AccessVersion - 09.50
NavPane Category - 0
UseMDIMode - 1
ShowDocumentTabs - True
Build - 735
HasOfflineLists - 70
Picture Property Storage Format - 0
CheckTruncatedNumFields - 1
ProjVer - 87
NavPane Closed - 0
NavPane Width - 311
NavPane View By - 0
NavPane Sort By - 1
Property Sheet Label Width - 2475
StartUpShowDBWindow - True
StartUpShowStatusBar - True
AllowShortcutMenus - True
AllowFullMenus - True
AllowBuiltInToolbars - True
AllowToolbarChanges - True
AllowSpecialKeys - True
UseAppIconForFrmRpt - False
AllowDatasheetSchema - True
Show Values Limit - 1000
Show Values in Indexed - 1
Show Values in Non-Indexed - 1
Show Values in Remote - 0
Auto Compact - 0
Show Navigation Pane Search Bar - 0
StartUpForm - Form1
 

LarryE

Active member
Local time
Today, 03:12
Joined
Aug 18, 2021
Messages
592
MsgBox CurrentDb.Properties("StartUpForm")
gave me the correct form
Thanks so much.
 

Users who are viewing this thread

Top Bottom