Windows - Activate .mdb

B

Bret

When I have 2 mdb's open, one is maximized on screen, the other minimized.
How do I, using code have one activate the other so it becomes maximized.

much thanks...
 
V

visdev1

This should give you access to another existing database.

Dim appAccess As Access.Application

Sub DisplayForm()
Const strConPathToSamples = "C:\TestApp\"

Dim strDB As String

' Initialize string to database path.
strDB = strConPathToSamples & "db1.mdb"
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB
' Open Orders form.
appAccess.DoCmd.OpenForm "Form1"
appAccess.Visible = True
appAccess.DoCmd.Maximize
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