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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|