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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Visual Basic Open Database as in Menu Selection 2

Status
Not open for further replies.

paulgenga

Programmer
Jan 8, 2004
61
KE
Hi,

I'm just wondering if this is possible,
When I select a recent database on the File Menu, the CurrentDatabse is closed and the selected database is openned on the same window without changing the size of the window.

I would greatly appreciate a VB Code that could do the same action.

Please.
 
Hi,

runcommand is the function that usually replicates the menu options you might select from the menubars or toolbars but you cant open recently used files with this method... you can open a database in the same workspace, so you could open another database and then close current one but you'd have to new the name and path of the other db - so I'm not sure if that helps...

HTH, Jamie
FAQ219-2884
[deejay]
 
how about an example of what you're talking about
since there isn't much documentation on: acCmdOpenDatabase.

Randall Vollen
National City Bank Corp.
 
I'm trying to switchbetween three databases with different information, a common purpose common and master files.

The move between one menu to another would best be in the same manner as they work on the menu. ie close current database open selected database. this even overlaps the need to retype the password.

The following code did not respond...

Code:
Sub TExpt()
' Initialize string to database path.
    Const strConPath = "\\Server\Exports Database\T-ShippersDbFile.mdb"
    strDB = strConPath & "T-ShippersDbFile.mdb"
    
' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    
' Open database in Microsoft Access window.

    appAccess.OpenCurrentDatabase strConPath
    
' Open Orders form.
'    appAccess.DoCmd.OpenForm "Orders"
    
End Sub

Please advice

 
Hi,

why dont you create a 'shell' access database that just has a menu or form and the code to open & close (or switch between) your 3 database? I've a colleague that did something similar - I'll ask him on Monday what he did...

HTH, Jamie
FAQ219-2884
[deejay]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top