Consulting

Results 1 to 2 of 2

Thread: Windows Explorer search in a Access 2010 db

  1. #1

    Windows Explorer search in a Access 2010 db

    10-15 years ago I integrated an Explorer type form into an Access 95 database. But I copied the code into an Access 2010 database and that program just didn't like it.

    Anyone have an easy way to search for a file inside Access? I'm trying to link photos to certain documents. I have the ability built in already to use a single directory for my data source, but have been told by the user that he needs a search capability.

    Any help appreciated.

  2. #2
    The FileDialog object is your tool. It's available as part of the Microsoft Office Object Model (in your References...), and you set one up like this:

    dim fDialog as Office.FileDialog
    
    set fDialog=new Application.FileDialog (msoFileDialogFilePicker)
    You now have all sorts of properties and methods available to you, the most important of which are (probably)

    .AllowMultiSelect To allow multiple selections; probably should be set to false
    .Title Puts a caption on the dialog box itself
    .Show A method to 'run' the dialog box
    .SelectedItems A collection of strings (file names) Either 1 (if AllowMultiSelect = false) or a whole load. -1 implies that Cancel was clicked...

    Ah yes - Filters. More than I want to get into right now, but post again if you want some more help. There are lots of good code examples from both the MS site, and probably in the knowledge base, here.

    HTH

    Tony

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •