how to use msoFileDialogFolderPicker ?

Discussion in 'Microsoft Access VBA Modules' started by Guest, Jun 7, 2007.

  1. Guest

    Guest Guest

    I'm not sure if I'm using this right. The following code lets me choose a
    folder, but it does not show what files are in it. This means the user has
    to check that the folder is correct (using Explorer or My Computer) before
    committing the dialog selection.


    Private Sub cmdChangeFolder_Click()

    ' N.B. Need to write a custom dialog that shows files in folder
    ' (so user know the bloody thing isn't empty!)

    With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    .Show
    pubInputFolder = .SelectedItems(1)
    txtFolder = pubInputFolder
    End With

    End Sub


    Is there something else I should be doing?

    Thanks!
     
    Guest, Jun 7, 2007
    #1
    1. Advertisements

  2. Guest

    Alex Dybenko Guest

    Hi,
    to select file (and folder) you can use this function:
    http://www.mvps.org/access/api/api0001.htm

    --
    Best regards,
    ___________
    Alex Dybenko (MVP)
    http://alexdyb.blogspot.com
    http://www.PointLtd.com

    "Allen_N" <> wrote in message
    news:...
    > I'm not sure if I'm using this right. The following code lets me choose a
    > folder, but it does not show what files are in it. This means the user
    > has
    > to check that the folder is correct (using Explorer or My Computer) before
    > committing the dialog selection.
    >
    >
    > Private Sub cmdChangeFolder_Click()
    >
    > ' N.B. Need to write a custom dialog that shows files in folder
    > ' (so user know the bloody thing isn't empty!)
    >
    > With Application.FileDialog(msoFileDialogFolderPicker)
    > .AllowMultiSelect = False
    > .Show
    > pubInputFolder = .SelectedItems(1)
    > txtFolder = pubInputFolder
    > End With
    >
    > End Sub
    >
    >
    > Is there something else I should be doing?
    >
    > Thanks!
    >
     
    Alex Dybenko, Jun 7, 2007
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    Thanks, Alex!

    "Alex Dybenko" wrote:

    > Hi,
    > to select file (and folder) you can use this function:
    > http://www.mvps.org/access/api/api0001.htm
    >
    > --
    > Best regards,
    > ___________
    > Alex Dybenko (MVP)
    > http://alexdyb.blogspot.com
    > http://www.PointLtd.com
    >
    > "Allen_N" <> wrote in message
    > news:...
    > > I'm not sure if I'm using this right. The following code lets me choose a
    > > folder, but it does not show what files are in it. This means the user
    > > has
    > > to check that the folder is correct (using Explorer or My Computer) before
    > > committing the dialog selection.
    > >
    > >
    > > Private Sub cmdChangeFolder_Click()
    > >
    > > ' N.B. Need to write a custom dialog that shows files in folder
    > > ' (so user know the bloody thing isn't empty!)
    > >
    > > With Application.FileDialog(msoFileDialogFolderPicker)
    > > .AllowMultiSelect = False
    > > .Show
    > > pubInputFolder = .SelectedItems(1)
    > > txtFolder = pubInputFolder
    > > End With
    > >
    > > End Sub
    > >
    > >
    > > Is there something else I should be doing?
    > >
    > > Thanks!
    > >

    >
    >
     
    Guest, Jun 7, 2007
    #3
  4. Guest

    Gert Guest

    Hi Alex,

    I have tried out this code successfully, however, the number of files you
    can select is quite limited (less than 25 in my case). I would like to extend
    this to up to 200 files. Can you help me out?

    Thanks
    Gert

    "Alex Dybenko" wrote:

    > Hi,
    > to select file (and folder) you can use this function:
    > http://www.mvps.org/access/api/api0001.htm
    >
    > --
    > Best regards,
    > ___________
    > Alex Dybenko (MVP)
    > http://alexdyb.blogspot.com
    > http://www.PointLtd.com
    >
    > "Allen_N" <> wrote in message
    > news:...
    > > I'm not sure if I'm using this right. The following code lets me choose a
    > > folder, but it does not show what files are in it. This means the user
    > > has
    > > to check that the folder is correct (using Explorer or My Computer) before
    > > committing the dialog selection.
    > >
    > >
    > > Private Sub cmdChangeFolder_Click()
    > >
    > > ' N.B. Need to write a custom dialog that shows files in folder
    > > ' (so user know the bloody thing isn't empty!)
    > >
    > > With Application.FileDialog(msoFileDialogFolderPicker)
    > > .AllowMultiSelect = False
    > > .Show
    > > pubInputFolder = .SelectedItems(1)
    > > txtFolder = pubInputFolder
    > > End With
    > >
    > > End Sub
    > >
    > >
    > > Is there something else I should be doing?
    > >
    > > Thanks!
    > >

    >
    >
     
    Gert, Apr 9, 2008
    #4
  5. Guest

    Alex Dybenko Guest

    Hi Gert,
    well, not sure i can anything do here, if this is api limitation. I think
    you can consider loading files into listbox and let user select there, or
    into temp table and select in datasheet form.

    --
    Best regards,
    ___________
    Alex Dybenko (MVP)
    http://accessblog.net
    http://www.PointLtd.com


    "Gert" <> wrote in message
    news:...
    > Hi Alex,
    >
    > I have tried out this code successfully, however, the number of files you
    > can select is quite limited (less than 25 in my case). I would like to
    > extend
    > this to up to 200 files. Can you help me out?
    >
    > Thanks
    > Gert
    >
    > "Alex Dybenko" wrote:
    >
    >> Hi,
    >> to select file (and folder) you can use this function:
    >> http://www.mvps.org/access/api/api0001.htm
    >>
    >> --
    >> Best regards,
    >> ___________
    >> Alex Dybenko (MVP)
    >> http://alexdyb.blogspot.com
    >> http://www.PointLtd.com
    >>
    >> "Allen_N" <> wrote in message
    >> news:...
    >> > I'm not sure if I'm using this right. The following code lets me
    >> > choose a
    >> > folder, but it does not show what files are in it. This means the user
    >> > has
    >> > to check that the folder is correct (using Explorer or My Computer)
    >> > before
    >> > committing the dialog selection.
    >> >
    >> >
    >> > Private Sub cmdChangeFolder_Click()
    >> >
    >> > ' N.B. Need to write a custom dialog that shows files in folder
    >> > ' (so user know the bloody thing isn't empty!)
    >> >
    >> > With Application.FileDialog(msoFileDialogFolderPicker)
    >> > .AllowMultiSelect = False
    >> > .Show
    >> > pubInputFolder = .SelectedItems(1)
    >> > txtFolder = pubInputFolder
    >> > End With
    >> >
    >> > End Sub
    >> >
    >> >
    >> > Is there something else I should be doing?
    >> >
    >> > Thanks!
    >> >

    >>
    >>
     
    Alex Dybenko, Apr 9, 2008
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack

    Invalid use of object with .Find method??

    Jack, Jun 30, 2003, in forum: Microsoft Access VBA Modules
    Replies:
    2
    Views:
    771
    Dirk Goldgar
    Jun 30, 2003
  2. David A Peterson

    Re: How to use Save as Common Dialog box in Acces

    David A Peterson, Jul 9, 2003, in forum: Microsoft Access VBA Modules
    Replies:
    0
    Views:
    595
    David A Peterson
    Jul 9, 2003
  3. Guest
    Replies:
    0
    Views:
    138
    Guest
    Oct 18, 2007
  4. how can i use the produc key after use to code.

    , Dec 13, 2009, in forum: Microsoft Access VBA Modules
    Replies:
    0
    Views:
    166
  5. Jignesh

    I want use accounting software in INDIA so pls help me for use

    Jignesh, Apr 22, 2010, in forum: Microsoft Access VBA Modules
    Replies:
    2
    Views:
    512
    Arvin Meyer [MVP]
    Apr 22, 2010
Loading...

Share This Page