Link to home
Start Free TrialLog in
Avatar of DerFuzh
DerFuzhFlag for United States of America

asked on

MS Access: Open specific directory from field criteria

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!
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

try

Shell "explorer.exe C:\ScannedFiles\" & [forms]![frmSomeForm]![SomeField], vbNormalFocus
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of DerFuzh

ASKER

EXCELLENT!  Thanks capricorn1 for the speedy response!  It's just what I was looking for!