Jump to content
Server Maintenance This Week. ×

Autocomplete foldername


This topic is 5640 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a problem that possibly has more than one solultion, and would be most grateful for any comments or ideas on what would be the best way to solve it.

I have a database where every record has a unique number (year + serial 000-999) e.g. 2008186. The records correspond to folders in a known location on a HDD. The foldernames all start with the number + keywords that are entered on creation by users. For instance "2008186 shipwreck dredging North Sea". The folders contain all documents pertaining the respective records in the DB (FMP9).

I have made a button "go to folder", with a send event script that finds the directories of the folders and should open the folder in explorer. But - as the DB only knows the number-part of the foldername, and not the keywords - the script won't work. I have looked for a batch command for the "Tab - autocomplete" function in the (WIN XP) cmd.exe, but no success so far. No two folders start with the same number, so this should work at least in theory.

One obvious solution is to rename all folders to the number only, but unfortunately that is not possible as the keywords are used for browsing folder directories manually as well.

I guess VBS is a viable way to go, but as I have very limited VBS knowledge I was hoping there was a simpler solution. For instance maybe could FM read a folder directory and find/match foldername to the unique recordnumber, or something...?

I hope my explanation of the problem makes sense...

Any ideas or comments?

Oyvind Odegard

Link to comment
Share on other sites

You might be right here, as long as you keep this in mind:

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000823

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000842

But to get to the OS, should you perhaps start here:

http://my.advisor.com/articles.nsf/aid/13345

...including pokes into these techniques:

http://www.connectingdata.com/downloads.htm

--sd

Link to comment
Share on other sites

I found a script here http://www.tek-tips.com/faqs.cfm?fid=5515 that I modified a bit.

"strDir = " & Quote($path) &"  ¶

Set FSO = CreateObject("Scripting.FileSystemObject")¶

Set objShell = CreateObject("WScript.Shell")¶ 

Set objDir = FSO.GetFolder(strDir)¶ 

getInfo(objDir)¶

¶

Sub getInfo(CurrentDir)¶

	For Each Item In CurrentDir.SubFolders¶ 

		If Left(Cstr(Item.name),7)=" & Quote($Folder) &  " Then¶

			objshell.run "cmd /c explorer.exe """ & Item.path & """"¶

		End If¶

	Next¶

End Sub¶

"

$path and $Folder are variables from the record.

Oyvind

Link to comment
Share on other sites

This topic is 5640 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.