Change "AllowBuiltinToolbars" - Property at runtime

N

Niels

Hello folks,
i have set the startup-property "AllowBuiltinToolbars" to
false to avoid displays this toolbar at my Access 2000
Application. I get problems with this by printing a report
from the report-preview, because the toolbar is not
availible.
I found this code to change the property by code, but it
works only after restarting the Application. There was not
effect to my running application. :-(

Public Sub ChangeProperty()
Dim db As DAO.Database
Dim prp As DAO.Property

On Error Resume Next
Set db = CurrentDb
db.Properties.Delete "AllowBuiltinToolbars"
Set prp = db.CreateProperty("AllowBuiltinToolbars",
dbboolean, true, true)
db.Properties.Append prp

Set prp = Nothing
Set db = Nothing
End Sub


Is there any possibility to change the value of this
property at runtime? How?
Thank in advance for any help.
Niels
 
G

George Nicholson

AFAIK, you can't really change it at runtime. Well, you can change it, but
the property setting takes effect only when the db opens.

Workaround: create a new toolbar called "CustomPrintPreview". Copy all the
icons from the BuiltIn PrintPreview toolbar to this new toolbar (this may
actually mean MOVING the icons from BuiltIn to Custom toolbar and then
RESETTING the original BuiltIn toolbar so that the "copied" icons reappear
on it).

Then, in the property sheet of your reports specify CustomPrintPreview as
the toolbar. This way you can leave "AllowBuiltInToolbars" set to No.

BTW, if you were developing a Runtime application you would have to do this
anyway since Runtime has no BuiltIn toolbars, just whatever toolbars the
developer has provided.
 
N

Niels

Hello George,

thanks a lot for information and the given workaround.
I think i will never get this solution without your help.
Your solution give me the opportunity to "remove" some
standardicons from the build in iconbar. :))

Greetings
Niels
 

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