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

Creating an Open Folder Control

P: 1
Hi Everyone,

Am attempting to use MS Access 2000 and ArcGIS to build a comprehensive Land Referencing system, that is orientated to the new and inexperienced user, while also being versatile enough so as it can be used on different projects,

I know this sounds like a relatively simple bit of code but every time I’ve look around other forums I get lost and confused, my VBA understanding is still rather basic so I apologise if this request sound stupid.

My question is how I create custom VBA control that allows me to specify a folder in a text field and then be able to browse its contents at the click of an associated button.

I am familiar with creating a hyperlink field in a table and just displaying the field in a form, but as I am creating a simple user interface, I would prefer to have the user freely able to modify path.

Cheers for any help.
Aug 3 '07 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,383
You'll want to take a look at the filedialog class.
Aug 3 '07 #2

ADezii
Expert 5K+
P: 8,669
Hi Everyone,

Am attempting to use MS Access 2000 and ArcGIS to build a comprehensive Land Referencing system, that is orientated to the new and inexperienced user, while also being versatile enough so as it can be used on different projects,

I know this sounds like a relatively simple bit of code but every time I’ve look around other forums I get lost and confused, my VBA understanding is still rather basic so I apologise if this request sound stupid.

My question is how I create custom VBA control that allows me to specify a folder in a text field and then be able to browse its contents at the click of an associated button.

I am familiar with creating a hyperlink field in a table and just displaying the field in a form, but as I am creating a simple user interface, I would prefer to have the user freely able to modify path.

Cheers for any help.
Just subscribing - will return later.
Aug 3 '07 #3

ADezii
Expert 5K+
P: 8,669
Hi Everyone,

Am attempting to use MS Access 2000 and ArcGIS to build a comprehensive Land Referencing system, that is orientated to the new and inexperienced user, while also being versatile enough so as it can be used on different projects,

I know this sounds like a relatively simple bit of code but every time I’ve look around other forums I get lost and confused, my VBA understanding is still rather basic so I apologise if this request sound stupid.

My question is how I create custom VBA control that allows me to specify a folder in a text field and then be able to browse its contents at the click of an associated button.

I am familiar with creating a hyperlink field in a table and just displaying the field in a form, but as I am creating a simple user interface, I would prefer to have the user freely able to modify path.

Cheers for any help.

Before you do anything, set a Reference to the Microsoft Office XX.XX Object Library.

Assuming a Text Box on your Form named txtFolder and a Command Button next to this Text Box, in the Click() Event of this Command Button, place the following code. This code will enable you to Browse the Folder you specify in [txtFolder], if the Folder doesn't exist, the My Documents Folder will be open:

Expand|Select|Wrap|Line Numbers
  1. 'If nothing is in txtFolder then get out!
  2. If IsNull(Me![txtFolder]) Then Exit Sub
  3.  
  4. Dim varItem As Variant
  5.  
  6. With Application.FileDialog(msoFileDialogFilePicker)
  7.    With .Filters
  8.      .Clear
  9.      .Add "All Files", "*.*"
  10.    End With
  11.        .AllowMultiSelect = False
  12.        .InitialFileName = Me![txtFolder]
  13.        .InitialView = msoFileDialogViewDetails
  14.               If .Show Then
  15.                 'not needed at this point
  16.                 For Each varItem In .SelectedItems
  17.                 Next varItem
  18.               End If
  19. End With
Aug 3 '07 #4

Post your reply

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