Ken Getz's GetOpenFile as Posted on Dev's site 
Author Message
 Ken Getz's GetOpenFile as Posted on Dev's site

Hello,

I made the switch to the code offered at Dev's site and originally authored
by Ken Getz, specifically the API Call for standard Windows File/Open Save
dialog box.  This is very nice code, but alas, I being a far less
sophisticated coder have an issue in the instances that I am using this code
which is

Private Sub FindFile_Click()

    Call GetOpenFile
    Me!MyFile = GetOpenFile

End Sub

where MyFile is set to an unbound text box object in a form and the code is
attached to a command button.  When I click on the commnad button, the code
correctly brings up a window where I can select a file.  After selecting the
file and clicking "open", the window closes and opens again.  The second
time I select the file and the file path and name are correctly displayed in
the MyFile object.

Why does the window open twice and only retain and update the file selection
the second time?

tia
Moira



Tue, 20 Apr 2004 05:23:40 GMT  
 Ken Getz's GetOpenFile as Posted on Dev's site
Because you have called the function twice. Just use the one line:

    Me!MyFile = GetOpenFile

The returned value is returned to your textbox. The first line you had used run
the function, but sent the returned value to Neverland.
--
Bruce M. Thompson, MVP

Quote:

> Hello,

> I made the switch to the code offered at Dev's site and originally authored
> by Ken Getz, specifically the API Call for standard Windows File/Open Save
> dialog box.  This is very nice code, but alas, I being a far less
> sophisticated coder have an issue in the instances that I am using this code
> which is

> Private Sub FindFile_Click()

>     Call GetOpenFile
>     Me!MyFile = GetOpenFile

> End Sub

> where MyFile is set to an unbound text box object in a form and the code is
> attached to a command button.  When I click on the commnad button, the code
> correctly brings up a window where I can select a file.  After selecting the
> file and clicking "open", the window closes and opens again.  The second
> time I select the file and the file path and name are correctly displayed in
> the MyFile object.

> Why does the window open twice and only retain and update the file selection
> the second time?

> tia
> Moira



Tue, 20 Apr 2004 05:45:13 GMT  
 Ken Getz's GetOpenFile as Posted on Dev's site
Mr. Thompson's comment is correct, but in addition you might want to check
out the relatively new FileSystemObject, it makes file handling very easy.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/scri...
ml/jsobjFileSystem.asp

Quote:

> Hello,

> I made the switch to the code offered at Dev's site and originally
authored
> by Ken Getz, specifically the API Call for standard Windows File/Open Save
> dialog box.  This is very nice code, but alas, I being a far less
> sophisticated coder have an issue in the instances that I am using this
code
> which is

> Private Sub FindFile_Click()

>     Call GetOpenFile
>     Me!MyFile = GetOpenFile

> End Sub

> where MyFile is set to an unbound text box object in a form and the code
is
> attached to a command button.  When I click on the commnad button, the
code
> correctly brings up a window where I can select a file.  After selecting
the
> file and clicking "open", the window closes and opens again.  The second
> time I select the file and the file path and name are correctly displayed
in
> the MyFile object.

> Why does the window open twice and only retain and update the file
selection
> the second time?

> tia
> Moira



Wed, 21 Apr 2004 00:43:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Ken Getz and Dev Ahish.........Mass Emailing question........

2. Ken Getz and Dev Ahish

3. Ken Getz or Dev Aishis PLEASE HELP

4. Access 97 Developer's Handbook, Ken Getz, Paul Litwin, Mike Gilbert

5. Ken Getz's basLinkedTables help

6. Getz's MSA 2.0 Dev. Handbook

7. Code doesn't work (from Dev's site)

8. Problem with Window Resizing code from Dev's site

9. IS DEV's SITE DOWN?

10. **** **** **** Hey Ken Getz**** **** ****

11. Message for Ken Getz

12. Help Please, Ken Getz!!

 

 
Powered by phpBB® Forum Software