yvroger
asked on
Open/close Navigation Pane programatically via vbscript
Hello everyone,
I would like to hide the MS Access navigation pane to certain unauthorized users.
Based on what I have been noticing, it seems like I can use: DoCmd.RunCommand acCmdWindowHide.
How can I do it from a vbscript that was set up to create the database in the first place?
Thanks.
I would like to hide the MS Access navigation pane to certain unauthorized users.
Based on what I have been noticing, it seems like I can use: DoCmd.RunCommand acCmdWindowHide.
How can I do it from a vbscript that was set up to create the database in the first place?
Thanks.
See here: https://www.experts-exchange.com/questions/26419734/Minimize-Navigation-Pane-Access-2007.html
ASKER
let me see if i can orient you a little better. In the vbscript, I created an object as follow:
Set oAccess = CreateObject("Access.Appli cation")
oAccess.OpenCurrentDatabas e (strDatabasePath)
Now that I have my object created, I wanted to know how the run the code below from a vbscript.
If RS("Role") = "Administrator" Then
DoCmd.SelectObject acTable, , True
Else
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
End If
I know it would work from a code behind (vb editor) in MS Access but i am not sure how to integrate the object (oAccess) with the command DoCmd.SelectObject...
Set oAccess = CreateObject("Access.Appli
oAccess.OpenCurrentDatabas
Now that I have my object created, I wanted to know how the run the code below from a vbscript.
If RS("Role") = "Administrator" Then
DoCmd.SelectObject acTable, , True
Else
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
End If
I know it would work from a code behind (vb editor) in MS Access but i am not sure how to integrate the object (oAccess) with the command DoCmd.SelectObject...
try
Set oAccess = CreateObject("Access.Appli cation")
oAccess.OpenCurrentDatabas e (strDatabasePath)
If RS("Role") = "Administrator" Then
oAccess.DoCmd.SelectObject acTable, , True
Else
oAccess.DoCmd.SelectObject acTable, , True
oAccess.DoCmd.RunCommand acCmdWindowHide
End If
Set oAccess = CreateObject("Access.Appli
oAccess.OpenCurrentDatabas
If RS("Role") = "Administrator" Then
oAccess.DoCmd.SelectObject
Else
oAccess.DoCmd.SelectObject
oAccess.DoCmd.RunCommand acCmdWindowHide
End If
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can obviously modify this to fit your specific log on security system...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Capricorn1 had actually responded correctly the first time. I just did not have a chance to post a feedback earlier. The code was on a vbscript separate from the database itself.
Boag2000, I really appreciated the little database you posted that I can use to build on. So I gave you some of the points as well.
Thank you all for your prompt and very useful responses.
Boag2000, I really appreciated the little database you posted that I can use to build on. So I gave you some of the points as well.
Thank you all for your prompt and very useful responses.
Hey, as long as you got your issue resolved, then it's all good.
;-)
Jeff
;-)
Jeff