Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open mdb from another mdb file 1

Status
Not open for further replies.

LiLgUrL

Technical User
Feb 9, 2003
59
CA
i have multiple mdb let's say 5 working mdb and i want to make a one mdb that will serve as the main menu so the user will not open all the mdb every now and then... like there would be 5 buttons in myMenu.mdb so if i click button 1 it will run 1.mdb and close the myMenu.mdb and if i clik 2 it will run 2.mdb and close myMenu.mdb... etc... something like that... is this possible? please advice - thanks in advance
 
Sure is. I've created this very thing before. Simply set the hyperlink property of each button to the full file path of the mdb that should be opened. Then, also add the following OnClick procedure for each button: DoCmd.Quit.

One additional note: When another .mdb file is opened via a hyperlink, the Web toolbar will always be displayed. If this is an issue, you may want to consider locking or removing that toolbar.

Cheers,

--
Mike

Why make it simple and efficient when it can be complex and wonderful?
 
thanks mike but how can i avoid the popup messages like: You can't exit Microsoft Office Access Now.... you may need to interrupt the module - then if i clik OK - another warning message: Hyperlinks can be harmful to your computer and data... Do you want to continue? - if YES - ok it will run selected mdb - but will not close my main mdb with the DoCmd.Quit
 
The message about hyperlinks being harmful to your computer is most likely a security setting (either on your local PC or the network) which should be turned off(if possible) in this scenerio.


To avoid the "You can't exit Microsoft Office Access Now" message, try replacing Docmd.Quit with:
Docmd.Close
Docmd.Quit

That may help.

--
Mike

Why make it simple and efficient when it can be complex and wonderful?
 
mike - but still it shows same message and will not close the main mdb - it will just be on design view.
 
Is there any other way? a command perhaps and how to implement it. Help please...
 
Hi!

You could try the approach given in oharab's faq faq705-1971, and call it with:

[tt]call fHandleFile("c:\other.mdb",win_normal)
application.quit[/tt]

- at least that work in my setup. If it continues to stay in design view/doesn't close the original db, then there might perhaps be some corruption issues, or there are other code preventing the close?

Roy-Vidar
 
thanks roy! is there an equivalent code for application.quit in VB6? - i tried using it also in vb6 and cool it works - but not with the quit thing... i used end but will just terminate the program. i want to exit vb6.
 
Think that's perhaps a question to seek answer for in the VB forum, forum222, though I know there are members frequenting the Access fora having lots of VB knowledge.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top