Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switching CurrentDB.Properties like "AllowFullMenus" back to true 1

Status
Not open for further replies.

freewilly

Programmer
Feb 19, 2001
43
0
0
AU
Hi Team

The security on my db switches all the functions like "AllowFullMenus" to false on startup.

But I want to give these functions back when the administrator logs on. I have tried Setting these properties to true and calling Properties.Refresh, but I still don't get the menus back.

So does anyone know how to get the menus back with code if they have been switched off.
 
I had to do this in code recently - try this:

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "(none)"
ChangeProperty "AllowFullMenus", DB_Boolean, True
End Sub

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top