Toolbars and Menu Bars

M

Michael

Hi Folks - Is there a way to set a custom toolbar and custom menu bar to the
database default, instead of setting the toolbar and menu bar properties for
each form? Thanks.

Michael
 
A

Arvin Meyer [MVP]

Michael said:
Hi Folks - Is there a way to set a custom toolbar and custom menu bar to
the database default, instead of setting the toolbar and menu bar
properties for each form? Thanks.

Run some code like (I adapted this code from something else that is working,
but as yet, this is untested):

Public Sub AddCustomToolbar()
On Error GoTo Error_Handler

Dim doc As DAO.Document
Dim db As DAO.Database
Dim frm As Form
'Dim ctr As DAO.Containers

Set db = CurrentDb

For Each doc In db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
Set frm = Forms(doc.Name)
frm.Toolbar = "Name of custom toolbar"
DoCmd.Close acForm, doc.Name, acSaveYes
Next

Exit_Here:
Set doc = Nothing
Set db = Nothing
Exit Sub

Error_Handler:
MsgBox Err.Number & ": " & Err.Description, vbOKOnly, "Error"
Resume Exit_Here

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