Re: looping through toolbars
- From: RLN <nospam@xxxxxxxxxx>
- Date: Tue, 02 Aug 2005 19:03:08 GMT
Yes, it is bombing on this line:
--> DoCmd.ShowToolbar strToolbar, acToolbarNo
Her is my code:
'Set Microsoft DAO 3.6 Object Library" in Tools/References
Dim dbs As Database
Set dbs = CurrentDb
Dim intlooper As Integer
For intlooper = 1 To CommandBars.Count
If CommandBars(intlooper).Name <> "Menu bar" Then
DoCmd.ShowToolbar strToolbar, acToolbarNo 'hide it
Debug.Print "Hiding " & _
CommandBars(intlooper).Name & " equals "_
acToolbarNo/False"
End If
Next intlooper
- - -
When VBA hits the line I referenced above, at this point Access 2002
crashes and I have to restart it.
To get around it, I have to reference each one individually, thus:
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Task Pane", acToolbarNo
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo
....etc...for all of them.
My bottom line target solution would be to turn off ALL toolbars in my
app and only show my customized toolbar (that does not have a Database
Window icon in it)
If anyone has a better way, let me know (that doesn't crash an Access
2002-SP3 development platform)
----------
"Perseverance - there is no substitute for hard work."
- Thomas Alva Edison
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: looping through toolbars
- From: Tim Marshall
- Re: looping through toolbars
- References:
- Re: looping through toolbars
- From: Tim Marshall
- Re: looping through toolbars
- Prev by Date: Re: Etiquette about reposting a question
- Next by Date: Re: Etiquette about reposting a question
- Previous by thread: Re: looping through toolbars
- Next by thread: Re: looping through toolbars
- Index(es):
Relevant Pages
|
Loading