Solved

Access97/Transfer Menubar

Posted on 1997-12-22
2
246 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

815 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

8 Experts available now in Live!

Get 1:1 Help Now