I have used the following on numerous other projects without issue. For some reason I have a form that I am trying to use the on open event to hide the ribbon bar by way of :
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Sub
It generates an on open error. I tried it with and without maximize and also as an on load event with the same error result. Has anyone seen this? It worked previously and I can't seem to find what the problem is.
Thank you.
-Scott
Error with hide ribbon command
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Error with hide ribbon command
I've never seen that. What is the text of the error message?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Error with hide ribbon command
I received the following:
"The expression On Load you entered as the event property setting produced the following error: Sub or Function not defined."
Haven't seen this one before with that line of code.
Thanks Hans.
"The expression On Load you entered as the event property setting produced the following error: Sub or Function not defined."
Haven't seen this one before with that line of code.
Thanks Hans.
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Error with hide ribbon command
Weird. Have you checked Tools | References... in the Visual Basic Editor for missing references?
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Error with hide ribbon command
One other thing - has this database originally been created in Access 2003 or before (i.e. pre-Ribbon)?
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Error with hide ribbon command
The form I am having trouble with was imported from a 2003 db. Everything else built new in 2010.
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Error with hide ribbon command
Mindful of that, I will try to recreate the form native in 2010 to see if resolved. Simple enough.
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Error with hide ribbon command
Recreated my form and the error went away. Thanks for point me in the right direction . :-)
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Error with hide ribbon command
Historically your guesses have been much better than mine :-)
Thank you Hans.
Thank you Hans.