?
Solved

MS Access: Open specific directory from field criteria

Posted on 2011-10-03
4
Medium Priority
?
270 Views
Last Modified: 2012-05-12
I am familier with the code for opening an explorer directory from MS access, but I need to take it one step further.  I would like to be able to use the data from a field as criteria in the string for opening the directory.

For example:
I have a form with a feild for SSNs.  I also have a directory with folders named specific SSNs.  I would like to have the code below use the current recordset and open the folder that matches the data in the field.  

Is it similar to using a field for a parameter query [forms]![frmSomeForm]![SomeField]......?

Private Sub openDirectory_Click()

    Shell "explorer.exe C:\ScannedFiles\........", vbNormalFocus

End Sub

Any help is greatly appreciated!
0
Comment
Question by:DerFuzh
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36904892
try

Shell "explorer.exe C:\ScannedFiles\" & [forms]![frmSomeForm]![SomeField], vbNormalFocus
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 36904900
if the button is on the same form

Shell "explorer.exe C:\ScannedFiles\" & Me.[SomeField], vbNormalFocus

you can also use

followhyperlink  "C:\ScannedFiles\" & Me.[SomeField]
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 36904932
Really, you have folders named with the value of SSNs?  

Hope you are prepared for the lawsuits that will accompany that when someone who shouldn't have access to the server gets access.
0
 

Author Closing Comment

by:DerFuzh
ID: 36905142
EXCELLENT!  Thanks capricorn1 for the speedy response!  It's just what I was looking for!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question