pongthai said:
Hi,
I have set the startup property in Tools/Startup for my database with "Display Database Window" unchecked. It does actually hide the database window in MS Access 2000, however, in Access 2002(XP), the window was hidden at startup but then shown again after I click on the MS Acess taskbar.
Anyone recognize this as a bug? Are there any workaround for this?
Thanks,
Pongthai.
What I do is set them on and off using Visual basic code.
That way you can turn everything off to minimum, and when you need to edit your database, turn them all back on.
Sorry about the bad code. I got it straight from the help page and I havent really read it, or formatted it. All I know is that it works.
This is your code for turning them on (or off if you use false):
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Login"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
ChangeProperty "AllowShortcutMenus", DB_Boolean, True
ChangeProperty "AllowToolbarChanges", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
And this is the function you need:
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