Need Macro to Open Access

L

Launchnet

I need help with 2 Macros. The first sample opens Access, but does not show
the menu on the right where you can choose a blank database or a previous
completed database. The sample I show below is where I tried to convert a
Macro that opens a blank Word Document.


Sub NewAccessOnly()
Dim oAccessApp As Object
Set oAccessApp = CreateObject("Access.Application")
oAccessApp.Visible = True
oAccessApp.Documents.Add DocumentType:=wdNewBlankDocument
End Sub


The next sample is again where I have tried to modify an existing Macro that
opens a actual Word Document. Naturally, it doesn't work either.

Sub NewAccessWithDocument()
Dim oAccessApp As Object
Dim oAccessDoc As Object

Set oAccessApp = CreateObject("Access.Application")
oAccessApp.Visible = True
Set oAccessDoc = oWordApp.Documents.Open( _
"C:\documents and settings\default\my documents\AVPDatabaseSample.mdb")

End Sub

I'm not a strong programmer, but this looks like the last step to be
completed in my project.

I would appreciate any help with these 2 Macros.

Thanks in Advance
Matt@Launchnet
 
M

Mike

Sub openAccess()

Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub
 
L

Launchnet via OfficeKB.com

Thanks Mike . . . Access opens fine, but the operator needs to click on the
bottom tab in order to display it. It is hidden behind the Excel Workbook
that it is being Launched from. Isn't there some way to display it like it
does in Word ?

Secondly, I still need another Macro that will open the actual
"AVPDatabaseSample.mdb" and display it.

Many thanks Mike

Matt@Launchnet


Sub openAccess()

Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub
I need help with 2 Macros. The first sample opens Access, but does not show
the menu on the right where you can choose a blank database or a previous
[quoted text clipped - 29 lines]
Thanks in Advance
Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
L

Launchnet via OfficeKB.com

Hi MH (Mike ?)
I went to your suggested site and got Access to open the database I wanted it
to. Thanks Much.

I still have a problem with opening just Access and having it displayed. I
have to click on the bottom tab to view Access. The Macro does open Access,
but I want it displayed automatically.

My code is:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub

What can I add to have it displayed automatically ?
Thanks Again.

Matt@Launchnet

- - - - - - - - - - - - - - - - - - - - - - - - - - -
http://techonthenet.com/excel/macros/open_access.php

MH
I need help with 2 Macros. The first sample opens Access, but does not
show
[quoted text clipped - 31 lines]
Thanks in Advance
Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
L

Launchnet via OfficeKB.com

More info on my current problem where I have to click on the bottom tab to
view it.
The problem I forgot to mention, is that 2 instances of Access are opened and
I only want 1.
Sorry I forgot.

Matt@Launchnet

- - - - - - - - - - - - - - - - -
Hi MH (Mike ?)
I went to your suggested site and got Access to open the database I wanted it
to. Thanks Much.

I still have a problem with opening just Access and having it displayed. I
have to click on the bottom tab to view Access. The Macro does open Access,
but I want it displayed automatically.

My code is:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub

What can I add to have it displayed automatically ?
Thanks Again.

Matt@Launchnet

- - - - - - - - - - - - - - - - - - - - - - - - - - -
[quoted text clipped - 5 lines]

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
M

MH

You may find that this works better:

ActiveWorkbook.FollowHyperlink Address:="F:\My Documents\MyDatabase.mdb"

I'm still unsure as to what you expect this to do, if this is insufficient
please post a full explanation of what you expect to happen.

MH

Launchnet via OfficeKB.com said:
More info on my current problem where I have to click on the bottom tab to
view it.
The problem I forgot to mention, is that 2 instances of Access are opened
and
I only want 1.
Sorry I forgot.

Matt@Launchnet

- - - - - - - - - - - - - - - - -
Hi MH (Mike ?)
I went to your suggested site and got Access to open the database I wanted
it
to. Thanks Much.

I still have a problem with opening just Access and having it displayed.
I
have to click on the bottom tab to view Access. The Macro does open
Access,
but I want it displayed automatically.

My code is:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub

What can I add to have it displayed automatically ?
Thanks Again.

Matt@Launchnet

- - - - - - - - - - - - - - - - - - - - - - - - - - -
[quoted text clipped - 5 lines]
Thanks in Advance
Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
L

Launchnet via OfficeKB.com

Good Morning MH . . .

Thanks for the latest macro.

What I still need help with is on the following macro. It works, but Access
is displayed behind Excel, which is where I clicked on the Macro. I do not
want a database opened.

I just need Access to be displayed in front of Excel, not behind.

ACTUAL CODE:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub

Maybe there is a better way ?

GRATITUDE:
I really appreciate the help you and others have given me. It truly is very
appreciated.

FUTURE:
The last macro I will need help with ( I hope it is the last ) is to have a
Macro that will open Windows Explorer at the top of the tree, which I mean
the same display as when you open Windows Explorer directly, or manually.

PURPOSE:
You asked for more detail on why I am requesting these Macros. Well, I have
developed a menu system for my customers, which they love by the way, and
these are additions that have been requested. The menu has 20 links out to
20 pages in the workbook. Additionally, I have unlimited links to any Word,
Excel, or Access documents that the user may have. I also have standard
links out to sites such as Hotmail, which I use, Juno eMail, which I use,
Google, Yahoo, MSN, and various help forums and learning sites.

I think this is the best that I can describe it. I'll be glad to answer any
questions you may have.

Many Thanks Again

Matt@Launchnet
You may find that this works better:

ActiveWorkbook.FollowHyperlink Address:="F:\My Documents\MyDatabase.mdb"

I'm still unsure as to what you expect this to do, if this is insufficient
please post a full explanation of what you expect to happen.

MH
More info on my current problem where I have to click on the bottom tab to
view it.
[quoted text clipped - 36 lines]

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
M

MH

Try this:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE",
vbNormalFocus
End Sub

And for windows explorer:

Sub NewExplorerOnly()
Shell "C:\WINDOWS\Explorer.exe /e,/select,c:\", vbNormalFocus
End Sub

MH

Launchnet via OfficeKB.com said:
Good Morning MH . . .

Thanks for the latest macro.

What I still need help with is on the following macro. It works, but
Access
is displayed behind Excel, which is where I clicked on the Macro. I do
not
want a database opened.

I just need Access to be displayed in front of Excel, not behind.

ACTUAL CODE:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
End Sub

Maybe there is a better way ?

GRATITUDE:
I really appreciate the help you and others have given me. It truly is
very
appreciated.

FUTURE:
The last macro I will need help with ( I hope it is the last ) is to have
a
Macro that will open Windows Explorer at the top of the tree, which I mean
the same display as when you open Windows Explorer directly, or manually.

PURPOSE:
You asked for more detail on why I am requesting these Macros. Well, I
have
developed a menu system for my customers, which they love by the way, and
these are additions that have been requested. The menu has 20 links out
to
20 pages in the workbook. Additionally, I have unlimited links to any
Word,
Excel, or Access documents that the user may have. I also have standard
links out to sites such as Hotmail, which I use, Juno eMail, which I use,
Google, Yahoo, MSN, and various help forums and learning sites.

I think this is the best that I can describe it. I'll be glad to answer
any
questions you may have.

Many Thanks Again

Matt@Launchnet
You may find that this works better:

ActiveWorkbook.FollowHyperlink Address:="F:\My Documents\MyDatabase.mdb"

I'm still unsure as to what you expect this to do, if this is insufficient
please post a full explanation of what you expect to happen.

MH
More info on my current problem where I have to click on the bottom tab
to
view it.
[quoted text clipped - 36 lines]
Thanks in Advance
Matt@Launchnet

--
Please take a look at www.openoursite.com Click on: "Keywords" and then
Click on "Matt's Story" and if you are a man, you should be very happy
that
you read my story. God Bless for everyones help.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
L

Launchnet via OfficeKB.com

Good Morning Again . . .

Both work and I thank you very much.
Have a Great Day.

Matt@Launchnet

Try this:

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE",
vbNormalFocus
End Sub

And for windows explorer:

Sub NewExplorerOnly()
Shell "C:\WINDOWS\Explorer.exe /e,/select,c:\", vbNormalFocus
End Sub

MH
Good Morning MH . . .
[quoted text clipped - 62 lines]
 

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