By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Bringing Custom Toolbars back to Acc rt

P: n/a
One of my clients is using Acc97 runtime to run an Access application.
The application has a Custom Toolbar, but she excluded the toolbar from
the application.
Now, I cannot display the toolbar again.
Because it is a runtime, there is no "View" menu.
I tried to replace the application with a zipped copy, but even that
did not bring the toolbar back.
Is there any way to bring the toolbar back?
Thanks in advance.

Nov 28 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I have code called from my Menu to make my toolbars visible or invisible.

Also, I have set the property for my custom toolbars
and Menu to not allow hiding or moving

You should do that in the future.

For now, she can delete from the registry
HKEY CURRENT USER\SOFTWARE\MICROSOFT\OFFICE\8.0\ACCESS\SEETINGS \CommandBars

Then replace the application with a zipped copy

And the default settings will be restored for her.

(david)
"Mary Anne" <ki*******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
One of my clients is using Acc97 runtime to run an Access application.
The application has a Custom Toolbar, but she excluded the toolbar from
the application.
Now, I cannot display the toolbar again.
Because it is a runtime, there is no "View" menu.
I tried to replace the application with a zipped copy, but even that
did not bring the toolbar back.
Is there any way to bring the toolbar back?
Thanks in advance.

Nov 28 '05 #2

P: n/a
This was written in 1998. At that time it worked for AC97. If I were
going to use it I would test it first on copies of the two DBs
involved. It is run from the receiving DB.

Sub test()
GetMenus "C:\My Documents\Access\Elementary Formula\Elementary
Formula Application.mdb", _
"Elementary Formula"
End Sub

Sub GetMenus(ByVal dbsName As String, ParamArray MenuNames())
Dim bConfirmActionQueries As Boolean
Dim vMenuName As Variant
Dim rst As Recordset

On Error Resume Next

bConfirmActionQueries = GetOption("Confirm Action Queries")
If bConfirmActionQueries Then SetOption "Confirm Action Queries",
False

With DBEngine(0)(0)

Err = 0
.TableDefs("MSysCmdBars").Name = .TableDefs("MSysCmdBars").Name
If Err = 3265 Then 'table doesn't exist
.Execute "SELECT * INTO MSysCmdBars " _
& "FROM MSysCmdBars IN '" & dbsName & "' WHERE NO;"
.Execute "CREATE INDEX TbIndex ON MSysCmdBars (TbName) WITH
PRIMARY;"
End If
On Error GoTo 0
If UBound(MenuNames) = -1 Then 'no elements
.Execute "INSERT INTO MSysCmdBars " _
& "SELECT * FROM MSysCmdBars IN '" & dbsName & "';"
Else
For Each vMenuName In MenuNames
.Execute "INSERT INTO MSysCmdBars " _
& "SELECT * FROM MSysCmdBars IN '" & dbsName & "' " _
& "WHERE TBName = '" & vMenuName & "';"
Next vMenuName
End If

.TableDefs.Refresh
Set rst = .TableDefs("MSysCmdBars").OpenRecordset
With rst
If Not (.BOF = True And .EOF = True) Then
.MoveFirst
On Error Resume Next
Do
CommandBars.Add (!TBName)
.MoveNext
Loop Until .EOF
On Error GoTo 0
End If
End With
Set rst = Nothing
End With

If bConfirmActionQueries Then SetOption "Confirm Action Queries",
True

End Sub

Nov 28 '05 #3

P: n/a
Lyle Fairfield wrote:
This was written in 1998. At that time it worked for AC97. If I were
going to use it I would test it first on copies of the two DBs
involved. It is run from the receiving DB.

[snip code]

Wow, but I don't think the problem lie with the toolbar dissapearing
entirely, it was just hidden, a simple DoCmd.ShowToolBar would have
sufficed :-)
Nov 29 '05 #4

P: n/a
Sounds good to me! :-)
I suspect that
DoCmd.ShowToolBar
is a better command than
DoCmd.RecoverOldLostCode
anyway.

Nov 29 '05 #5

P: n/a
Thank you for a lot of ideas.

I wan't keen on changing registry, so I decided to go with code.
DoCmd.ShowToolBar worked for them.
I'll make sure from now on to set the property to not allow hiding or
moving.

I'm so glad I asked the question here.
Thanks very much.

Nov 30 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.