PC Review


Reply
Thread Tools Rate Thread

__Application.GetOpenFilename (*.txt)

 
 
=?Utf-8?B?bWFyY3VzLi4=?=
Guest
Posts: n/a
 
      20th Apr 2004
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

 
Reply With Quote
 
 
 
 
david epsom dot com dot au
Guest
Posts: n/a
 
      20th Apr 2004
The declarations have to go at the TOP of the module. If necessary,
cut the declarations again, and paste them further up.

(david)

"marcus.." <(E-Mail Removed)> wrote in message
news:4492E0B7-B59B-44D0-ADC8-(E-Mail Removed)...
> 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?
>
>
> 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 Boolean
> "
>
> and just after :
>
> "Type tagOPENFILENAME
> . . .
> End Type"
>
>
> I'm using Windows XP and Access 2000.
>
> Any suggestions?
>
> Thanks,
>
> Marcus.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetOpenFileName Gary S Microsoft Excel Programming 5 10th Jun 2008 04:42 PM
GetOpenFilename =?Utf-8?B?d3RwY29tcGxhYg==?= Microsoft Excel Programming 4 4th Jan 2005 06:36 PM
GetOpenFileName Greg Bloom Microsoft Excel Programming 2 9th Feb 2004 04:09 PM
GetOpenFilename Wolfgang Microsoft Excel Programming 1 6th Feb 2004 07:37 PM
GetOpenFileName GetOpenFileName Microsoft Excel Worksheet Functions 1 6th Nov 2003 06:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.