A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Button on form to open folder



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2009, 09:04 PM posted to microsoft.public.access.forms
Midget[_2_]
external usenet poster
 
Posts: 1
Default Button on form to open folder

Is there any way to open a folder from within a record on a form, that
will look at a field, and do a search through the folder location
looking for that name, regardless of what comes before or after it?
Basically I want to do a search using wildcards before and after the
field PR#.
Example.
Contract, PR#, Serial, Name
I have a folder named 555-RC, 0912301, 5674, Seals
I want my "Open Folder" Button to search that folder for *PR#* and
pull up the current records folder.
The code I have used is much more static, and doesn't really work
going backwards, only from here forward.

Private Sub OpenFolder_Click()
Dim FolderName As String
FolderName = Me![PR#] & ", " & Me![Serial] & ", " & Me![Name]
Dim ProjectPath
ProjectPath = "\\Server\Share\" & FolderName
Shell "c:\WINDOWS\explorer.exe """ & ProjectPath & "", vbNormalFocus
End Sub

I can have it search on any of the fields in the record, but the older
folders, thousands of them, did not necessarily follow the exact
naming scheme. However, the PR# is ALWAYS correct, this is why I want
to do something like I did above, which works, but allow it to search
for only PR# regardless of what comes before, or what follows it. I
am still new to this whole coding behind the forms thing, but think I
can get there with a little nudge. Thanks for all off your help.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.