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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Full menus & Database window for Admin

Status
Not open for further replies.

Zycmi

IS-IT--Management
Jun 19, 2002
42
CA
Hi,

I've set up a user/group accounts system for my database, as well as a startup switchboard.
In the startup configuration, I have unchecked "allow Full Menus" as well as "Display Database Window". This is definately what I want, however I would like for the Admin account to have access to these, Is there a command or an option that could permit me to activate these functions for the Administrator? Could I code that into a command button?

Thanks in advance for your time.

Zycmi
 
Here's some code pulled from Access Help for Startup Properties Example:

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Customers"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", 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

This should give you an idea.
 
Hi.

I tried those options thoroughly, though I don't think they've quite been answering my question.. Maybe I was misleading...
either way,
what I intend to do, is to take the menu bars, as well as the database window, and hide them from the start... that I don't have a problem with.. however. when I log on as the administrator, I want to be able to open the database window, as well as have complete access to my rolldown menus. How can I grant access to those items to only the administrator... How can I switch on and off all of those configurations without having to restart access??

thanks.
Zycmi
 
I see. I don't think you can get it without restarting Access. I know the code works, but, again, you would have to restart Access, then remember to change the settings back when you're done. The only other suggestion I can give is autoexec macro, but I don't know if that would do it. If so, you can use an environment variable to identify you. (autoexec.bat: user = admin; code: If VBA.Environ$("user") = admin)
Again, I doubt that would do it. I don't have any other answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top