By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

FileDialog control not found

P: 3
I have an Access2003 db that was converted from an Access2000 db. I would like to add a FileDialog control to a form but I don't see it in the Toolbox.

I added a reference to Miscrosoft Office 11.0 Objects. What more must I do?

Than you.
Jan 29 '08 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 446
Hi
You need Microsoft Common Dialogue Control, which is an Actixe X component that ships with VB or other Developer tools. I don't think it is a part of Access

The file to look for is;- cmdlg32.ocx

S7
Jan 29 '08 #2

ADezii
Expert 5K+
P: 8,597
I have an Access2003 db that was converted from an Access2000 db. I would like to add a FileDialog control to a form but I don't see it in the Toolbox.

I added a reference to Miscrosoft Office 11.0 Objects. What more must I do?

Than you.
If you are referring to the Microsoft Office File Dialog, which is shared by all Office Components, make the Reference as you already did, and write similar code to that below:
Expand|Select|Wrap|Line Numbers
  1. 'First, set a Reference to the Microsoft Office XX.X Object Library
  2.  
  3. Dim strButtonCaption As String, strDialogTitle As String
  4. Dim strHyperlinkFile As String
  5.  
  6. 'Define your own Captions if necessary
  7. strButtonCaption = "Save Hyperlink"
  8. strDialogTitle = "Select File to Create Hyperlink to"
  9.  
  10. With Application.FileDialog(msoFileDialogFilePicker)
  11.   With .Filters
  12.     .Clear
  13.     .Add "All Files", "*.*"     'Allow ALL File types
  14.   End With
  15.   'The Show Method returns True if 1 or more files are selected
  16.     .AllowMultiSelect = False       'Critical Line
  17.     .FilterIndex = 1 'Database files
  18.     .ButtonName = strButtonCaption
  19.     .InitialFileName = vbNullString
  20.     .InitialView = msoFileDialogViewDetails     'Detailed View
  21.     .Title = strDialogTitle
  22.   If .Show Then
  23.     For Each varItem In .SelectedItems 'There will only be 1
  24.       'Caption and Address of Hyperlink will be the same (Caption#Address)
  25.       strHyperlinkFile = varItem & "#" & varItem
  26.         Me![Link] = strHyperlinkFile
  27.     Next varItem
  28.   End If
  29. End With
Jan 30 '08 #3

Expert 100+
P: 446
If you are referring to the Microsoft Office File Dialog, which is shared by all Office Components, make the Reference as you already did, and write similar code to that below:
Wow, that's far better than using the OCX which may not exist on every user's computer.
Thanks ADezii
Jan 30 '08 #4

ADezii
Expert 5K+
P: 8,597
Wow, that's far better than using the OCX which may not exist on every user's computer.
Thanks ADezii
You are quite welcome, the code that I gave you is just a guideline, but it does list several Options for the File Dialog.
Jan 30 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.