Prev: Imported Form Changes
Next: Forms or Tables
From: esn on 4 Jun 2010 12:46 I'm terrible with VBA so this might be something really simple. In Access 2007, I have a startup form with this event on load: Private Sub Form_Load() DoCmd.SelectObject acTable, , True DoCmd.RunCommand acCmdWindowHide DoCmd.ShowToolbar "Ribbon", acToolbarNo End Sub and this on close: Private Sub Form_Close() DoCmd.SelectObject acTable, , True DoCmd.ShowToolbar "Ribbon", acToolbarYes End Sub I've also tried the first event as on open and there is no apparent difference in functionality. I got the code from searching for ways to hide the ribbon and navigation pane. These codes work perfectly for the navigation pane but don't seem to affect the ribbon at all. I've also tried splitting the first event up between on open and on load (hiding the nav pane on open and the ribbon on load) but that didn't work either. Any ideas on why hiding the ribbon isn't working? I swear I've gotten this to work before, without having to create a custom ribbon or anything, I just can't remember how.
From: Jörn Bosse on 4 Jun 2010 16:52 Hi, Hide Ribbon and menus: DoCmd.ShowToolbar "Ribbon", acToolbarNo Show Ribbon and menus: DoCmd.ShowToolbar "Ribbon", acToolbarYes Hide navigaionpanel: DoCmd.SelectObject acTable, , True RunCommand acCmdWindowHide Show navigationpanel: DoCmd.SelectObject acTable, , True Regards J�rn Bosse Am 04.06.2010 18:46, schrieb esn: > I'm terrible with VBA so this might be something really simple. In > Access 2007, I have a startup form with this event on load: > > Private Sub Form_Load() > DoCmd.SelectObject acTable, , True > DoCmd.RunCommand acCmdWindowHide > DoCmd.ShowToolbar "Ribbon", acToolbarNo > End Sub > > and this on close: > > Private Sub Form_Close() > DoCmd.SelectObject acTable, , True > DoCmd.ShowToolbar "Ribbon", acToolbarYes > End Sub > > I've also tried the first event as on open and there is no apparent > difference in functionality. I got the code from searching for ways > to hide the ribbon and navigation pane. These codes work perfectly > for the navigation pane but don't seem to affect the ribbon at all. > I've also tried splitting the first event up between on open and on > load (hiding the nav pane on open and the ribbon on load) but that > didn't work either. Any ideas on why hiding the ribbon isn't > working? I swear I've gotten this to work before, without having to > create a custom ribbon or anything, I just can't remember how.
From: esn on 4 Jun 2010 17:15 > Hide Ribbon and menus: > DoCmd.ShowToolbar "Ribbon", acToolbarNo > > Show Ribbon and menus: > DoCmd.ShowToolbar "Ribbon", acToolbarYes > > Hide navigaionpanel: > DoCmd.SelectObject acTable, , True > RunCommand acCmdWindowHide > > Show navigationpanel: > DoCmd.SelectObject acTable, , True Yeah so why isn't it working?
From: Jörn Bosse on 4 Jun 2010 17:35 Am 04.06.2010 23:15, schrieb esn: >> Hide Ribbon and menus: >> DoCmd.ShowToolbar "Ribbon", acToolbarNo >> >> Show Ribbon and menus: >> DoCmd.ShowToolbar "Ribbon", acToolbarYes >> >> Hide navigaionpanel: >> DoCmd.SelectObject acTable, , True >> RunCommand acCmdWindowHide >> >> Show navigationpanel: >> DoCmd.SelectObject acTable, , True > > Yeah so why isn't it working? Did you create a secure folder in the security center? Or do you always have to choose "Allow Macros" or something like this, when your db starts?
From: esn on 4 Jun 2010 17:46
Thanks for checking in again, > Did you create a secure folder in the security center? Or do you always > have to choose "Allow Macros" or something like this, when your db starts? The db is in a "trusted location," so events/macros aren't blocked, plus I have my default setting at "allow all macros" because the only db files I open are ones I built myself. Anything else it could be? |