Hi,
I had the same problem.
If you know, the Access has a lot of properties that has to be declared to work!
For ex. the "AllowBypassKey" property!
Or the "AllowShortcutMenus" propety!
Once you declare this kind of property you can't declar it again - you will receive an error message (just enter into the sub the On Error Resume next line)
Here is an example in VB (it's same in Access but You don't have to declare the DAO):
Private Sub cmdGo_Click()
Dim db As dao.Database
Dim prp As dao.Property
Dim strProp As String
Dim i As Integer
If Len(Nz(Me.txtDB)) = 0 Then Exit Sub
Set db = DBEngine.OpenDatabase(Me.txtDB)
On Error GoTo Err_H
For i = 1 To 4
Select Case i
Case 1
strProp = "AllowBypassKey"
Case 2
strProp = "StartupShowDBWindow"
Case 3
strProp = "AllowFullMenus"
Case 4
strProp = "AllowShortcutMenus"
End Select
If Me.chkDeveloper Then
db.Properties(strProp) = -1
Else
db.Properties(strProp) = 0
End If
Next i
Unload Me
Exit Sub
Err_H:
Select Case Err.Number
Case 3270 'Property not found
CreateProp db, strProp
Resume
Case Else
MsgBox Err.Number & " " & Err.Description, vbCritical
Unload Me
Exit Sub
End Select
End Sub
Public Sub CreateProp(ByVal db As dao.Database, ByVal strProp As String)
Dim prp As dao.Property
Set prp = db.CreateProperty(strProp, dbBoolean, False, True)
db.Properties.Append prp
Set prp = Nothing
End Sub
Tibi