97 to 2003 conversion issue - HELP

J

Jamie

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
 
G

Guest

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 said:
Next cb
CommandBars("Menu Bar").Enabled = False 'Can't be made invisible, so


Jamie said:
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
 
J

Jamie

It is for sure something in this code:
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

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:
(air code)
For Each cb In CommandBars
if cb.name said:
Next cb
CommandBars("Menu Bar").Enabled = False 'Can't be made invisible, so


Jamie said:
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
 
J

Jamie

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.




Jamie said:
It is for sure something in this code:
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

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:
(air code)
For Each cb In CommandBars
if cb.name said:
Next cb
CommandBars("Menu Bar").Enabled = False 'Can't be made invisible, so


Jamie said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top