Home > Software engineering >  MS Access Current Database Display Form Property Not Saving
MS Access Current Database Display Form Property Not Saving

Time:10-06

I have an MS Access database that uses the Display Form property (under Options>Current Database) to automatically open a form when the database is loaded. For some reason, today when I updated some other Options unrelated to the Display Form property, I'm getting this pop-up, and whenever I try to select a new Display Form, the Display Form is not saved (the next time I open the Options menu, the Display Form drop down has nothing selected). Does anyone know what's going on here or if there's another way to set the Display Form property besides the Options menu? Thanks in advance! enter image description here

enter image description here

CodePudding user response:

if there's another way to set the Display Form property besides the Options menu?

The Display Form setting is stored as a database property named "StartUpForm". You can use VBA to manage that property. Here's an example from the Immediate window. (You can use Ctrl g to go to the Immediate window.)

' if the property currently exists, this should remove it;
' if it does not exist, this will trigger error 3265,
' "Item not found in this collection" --- just ignore the error
currentdb.Properties.Delete "StartUpForm"

' now create the property with the name for your display form; mine will be Form1
set prp = currentdb.CreateProperty("StartUpForm", dbText, "Form1")

' finally add the new property to the database properties collection
currentdb.Properties.Append prp

' if you want to verify your change was saved ...
? currentdb.Properties("StartUpForm").Value
Form1

I'm not confident that method will let you successfully set your Display Form when you can't do it via the Access Options UI. But, perhaps it will reveal something useful about why it fails. Good luck.

  • Related