__Application.GetOpenFilename (*.txt)

G

Guest

Hi

If you have seen this message before, your right it was reposted, as replies to the original post seem to keep ‘disappearingâ€

I'm trying to do the following in access as opposed to excel

fileToOpen = Application
.GetOpenFilename("Text Files (*.txt), *.txt"
If fileToOpen <> False The
MsgBox "Open " & fileToOpe
End I

How can I rewrite this so the user can select the file to be uploaded

It has been suggested (thanks Larry) that I can use the Windows Common Dialog directly, using the information and cod
you'll find at http://www.mvps.org/access/api/api0001.htm.

I can’t seem to make it work. Do i need to turn on 'Common Dialog Control ' as a reference or something... if so, where do i find it and what is its name

I get an error when i try and run the macro
"Only comments may appear after End Sub, End Function or End Property

I have copied and pasted the text in the shaded area exactly from the web site link

It highlights the following text
“Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll"
Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolea
â€

and just after

“Type tagOPENFILENAM
… … â€
End Typeâ€

I'm using Windows XP and Access 2000

Any suggestions

Thanks

Marcus
 
D

david epsom dot com dot au

The declarations have to go at the TOP of the module. If necessary,
cut the declarations again, and paste them further up.

(david)

marcus.. said:
Hi,

If you have seen this message before, your right it was reposted, as
replies to the original post seem to keep 'disappearing'
I'm trying to do the following in access as opposed to excel:

fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End If

How can I rewrite this so the user can select the file to be uploaded?

It has been suggested (thanks Larry) that I can use the Windows Common
Dialog directly, using the information and code
you'll find at http://www.mvps.org/access/api/api0001.htm.

I can't seem to make it work. Do i need to turn on 'Common Dialog Control
' as a reference or something... if so, where do i find it and what is its
name?
 

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