Hiding all Access 2002 toolbars

S

Silvester

Hi,

In my A2000 app I hide all access toolbars programatically on program
startup using docmd.showtoolbar "x.. ", actoolbarno.

On distribution, this works great on user machines running Office 2000.

Access 2002 has this new toolbar (?) that appears on the rhs corner of the
screen with buttons "Microphone, Tools, Handwriting, etc"

How do I get rid of this/all Access 2002 toolbars using code ?

Thanks for any help.
 
A

Allen Browne

Did you try setting the Allow Built in Toolbars property to No?

Under Tools | Startup, or programmatically you can create/set the database's
AllowBuiltinToolbars property.
 
S

Silvester

Thanks Allen,

Yes, the Ällow built-in toolbars option was checked under Tools | Startup.
More importantly the "Use Access Special Keys"was checked under |Advanced.
Unchecking it manually killed the Access 2002 new toolbar problem.

How can I manipulate these 2 startup checkboxes using code to ensure this
stays unchecked (False) ?

Thanks for your help
 
A

Allen Browne

Call ChangeProperty(db, "AllowSpecialKeys", dbBoolean, bSet)
Call ChangeProperty(db, "AllowBuiltinToolbars", dbBoolean, False)

Function ChangeProperty(dbs As Database, strPropName As String, varPropType
As Variant, varPropValue As Variant) As Integer
Dim prp As Property
Const conPropNotFoundError = 3270

On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Debug.Print strPropName & " is " & varPropValue

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
 
S

Silvester

calling :
Call ChangeProperty(db, "AllowSpecialKeys", dbBoolean, bSet)
Call ChangeProperty(db, "AllowBuiltinToolbars", dbBoolean, False)

generates the compile error "ByRef argument type mismatch"

Am I doing something wrong ?
 
A

Allen Browne

Sorry: pasted from an app where db was already set.

Try:
Call ChangeProperty(CurrentDb(), "AllowSpecialKeys", dbBoolean, False)
Call ChangeProperty(CurrentDb(), "AllowBuiltinToolbars", dbBoolean, False)
 
S

Silvester

Thank you.It worked perfectly. Rom 8:28

Allen Browne said:
Sorry: pasted from an app where db was already set.

Try:
Call ChangeProperty(CurrentDb(), "AllowSpecialKeys", dbBoolean, False)
Call ChangeProperty(CurrentDb(), "AllowBuiltinToolbars", dbBoolean, False)
 

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