Common dialog control

  • Thread starter Thread starter reidarT
  • Start date Start date
R

reidarT

I use a commonDialogControl to open a directory with text-files.
When I select a file and click Open, I want to fill a text-field with the
filename, but I can't find out how?
regards
reidarT
 
reidarT said:
I use a commonDialogControl to open a directory with text-files.
When I select a file and click Open, I want to fill a text-field with the
filename, but I can't find out how?


There should be a way, but the standard recommendation is to
avoid that thing like the plague. Instead, you should use
the code at http://www.mvps.org/access/api/api0001.htm
 
Thanks alot, but how can I place the filename in a field.
You do it in a msgbox.
regards
reidarT
 
The function returns the name and once you get it into a
variable, you can just assign it to a control's Value. E.g.

Dim strName As String
. . .
strName = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
Me.sometextbox = strName

You may want to analyze the GetOpenFile function for an
example of using this in a specific context. Your procedure
will probably look more like this.
 
Back
Top