Pass API dialog selection to control

J

John Hipskind

Using API001, I've been able to open the file selection
dialog from within a control.
How do I make the selected file the current value of that
field?
(I'm selecting Excel files to import)
Thanks.
John
 
D

Douglas J. Steele

That code has the following example for selecting Excel files:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

You just need to add a line after that:

Me!MyControl = strInputFileName

(replace MyControl with the name of your control)
 

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