Solved

Access97/Transfer Menubar

Posted on 1997-12-22
2
242 Views
Last Modified: 2008-03-06
I am working in Access 97 and I have created a function that will query records based on user input and then create a new database.  I then export the new querydef and data as a table to the new database using the TransferDatabase method.  I am also exporting a report to the new database.  This report uses a custom menubar.  My problem is this; when I export the report, the menubar does not go with it.  Is there a way to transfer a menubar that is not a macro?  I know it can be done from an open database using the 'Get External Data' selection from the file menu.  But I need to export not import.  Any suggestions?
0
Comment
Question by:STKeith
2 Comments
 

Accepted Solution

by:
mikeeec earned 100 total points
ID: 1963457
I do not know of any way to directly export a custom menubar.  I think the best solution would be to use the CommandBars.Add method, along with the necessary code to completely recreate your menubar in the new database.  This should be fairly straightforward, because you can simply copy the appropriate commands and code from the menubar you have already created.  The initial code would be written as follows:

Set MyNewMenu = CommandBars.Add(Name:="MyMenu", Position:=msoBarRight, MenuBar:=True)
With MyNewMenu
     .Protection = msoBarNoMove
     .Visible = True
End With
 Then, simply use the Add method to add your custom controls to the newly created menubar.
0
 

Author Comment

by:STKeith
ID: 1963458
Thanks mikeeec.  This sounds like it will do the trick.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now