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!

Opening File in Access?

Status
Not open for further replies.

Phoenix22

Technical User
Sep 23, 2003
29
CA
Hi,

I'm trying to automatically open a file in Access using:

Application.GetOpenFilename

However, it doesn't work; is there another VBA command I could use?

Thank you for your time.
 
Hi Phoenix,

You should try using ShellExecute:


-------------------GLobal Declarations--------------
Public Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
-------------------GLobal Declarations--------------



-------------------Opening File--------------
Dim retval As Long

retval = ShellExecute(0, "open", "C:\filename.txt", "", "", 0)

-------------------Opening File--------------





Regards,
gkprogrammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top