Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Conversion / November 2006

Tip: Looking for answers? Try searching our database.

97 to 2003 conversion issue - HELP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamie - 20 Oct 2006 20:42 GMT
I'm getting a lockup state when running a process in my database once
updated.

I believe it has to do with this code can someone give me some details.
--------------------------------------------------------------------------------------
Sub GoToDesign()

 On Error Resume Next  'Ignore all errors, continue if possible...
 Call UserTrace([Screen].[ActiveForm].[Name], Me.[ActiveControl].[Name])
'Fill tblAccessData with info

 DoCmd.Close acForm, "frmAbout"
 DoCmd.Close acForm, "frmSwitchboard"
 DoCmd.Close

 Call KillCommandBars
 Call SeeCommandBars
 ChangeProperty "AllowFullMenus", dbBoolean, True 'Allow Full Menus

 DoCmd.SelectObject acTable, , True  'Unhide the database window, without
dialog box
 'DoCmd.RunCommand acCmdWindowUnhide...unhides, but opens dialog box
 DoCmd.Maximize  'the DB windown

End Sub

---------------------------------------------------------------------------------------------
Sub KillCommandBars()
 Dim cb As CommandBar 'Requires MS Office 8.0 Object Library (Tools,
References (in Module Design))

 On Error Resume Next 'following code tries to make Menu Bar invisible,
causing error.
 For Each cb In CommandBars
   cb.Visible = False
 Next cb
 CommandBars("Menu Bar").Enabled = False 'Can't be made invisible, so
disable it, making it invisible

End Sub

------------------------------------------------------------------------------------------------------
Sub SeeCommandBars()

 Application.SetOption "Built-In Toolbars Available", True
 CommandBars("Menu Bar").Enabled = True
End Sub
david@epsomdotcomdotau - 22 Oct 2006 23:45 GMT
Get rid of 'on error resume next', so that you can see what is
going on. Where necessary, use an If statement to avoid errors:
(air code)

>   For Each cb In CommandBars
       if cb.name <> "Menu Bar" then     cb.Visible = False
>   Next cb
>   CommandBars("Menu Bar").Enabled = False 'Can't be made invisible, so

> I'm getting a lockup state when running a process in my database once
> updated.
[quoted text clipped - 23 lines]
>
> --------------------------------------------------------------------------
-------------------
> Sub KillCommandBars()
>   Dim cb As CommandBar 'Requires MS Office 8.0 Object Library (Tools,
[quoted text clipped - 11 lines]
>
> --------------------------------------------------------------------------
----------------------------
> Sub SeeCommandBars()
>
>   Application.SetOption "Built-In Toolbars Available", True
>   CommandBars("Menu Bar").Enabled = True
> End Sub
Jamie - 22 Nov 2006 19:22 GMT
It is for sure something in this code:
> Sub KillCommandBars()
>   Dim cb As CommandBar 'Requires MS Office 8.0 Object Library (Tools,
[quoted text clipped - 9 lines]
>
> End Sub

If I rem out the call for KillCommandBars I do not have a problem.  I did do
what you suggested but would get code errors.

Any other suggestions to why the above code causes a lockup and Access to
close and restart?

> Get rid of 'on error resume next', so that you can see what is
> going on. Where necessary, use an If statement to avoid errors:
[quoted text clipped - 56 lines]
>>   CommandBars("Menu Bar").Enabled = True
>> End Sub
Jamie - 22 Nov 2006 19:28 GMT
Sorry I am wrong.

It isn't something in KillCommandBars as it is still happening.  Could be a
combination but it is still locking up?

See for some reason sometimes on the first open it will work and allow me in
without locking up.  Then after this it will lock up every time.  I thought
I had it last time but after double checking it still freezes.

Still investigating to see if I can narrow the field.

> It is for sure something in this code:
>> Sub KillCommandBars()
[quoted text clipped - 78 lines]
>>>   CommandBars("Menu Bar").Enabled = True
>>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.