Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Entries in Form for Search

Status
Not open for further replies.

EMoore12

Technical User
Oct 6, 2004
30
0
0
US
Hello,
I have a form located on a .htm page where someone can select a state. What I need to happen is once the user selects the state and clicks the Submit button, the code should search the specified network location for the existence of that state's document. If the document is found, then another .htm page should open containing a link to that document. Here is what I have so far:

On Error Resume Next

Dim objFSO, oFO, oFolder, oFile, TSADir, IE

Dim objStream


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objStream =
objFSO.createtextfile("K:\orkand\DAEBTools\TSASearch.htm",True)
CheckFolder(objFSO.getfolder("I:\CABINETS\TSB\TSAREPORT\")), objStream

Set IE = CreateObject("InternetExplorer.Application")

Sub Checkfolder(objCurrentFolder, objLogFile)
Dim strSearch
Dim strTemp

strSearch=document.getElementsByID("State").value


For Each objFile In objCurrentFolder.Files
strTemp=Left(objFile.Name,6,2)
If strSearch = strTemp Then
strOutput = "<A href=" & CStr(objFile.Path) & ">" & CStr(objFile.Path) & "</A>""
objLogFile.writeline strOutput
End If
Next
For Each objNewFolder In objCurrentFolder.subfolders
CheckFolder objNewFolder, objLogFile
Next
End sub

Any help you could provide would be appreciated.

...ecm
 
[0] All in all, the problem is?

[1] >strSearch=document.getElementsByID("State").value
[tt]strSearch=document.getElemen[highlight]tB[/highlight]yID("State").value[/tt]

[2] >strOutput = "<A href=" & CStr(objFile.Path) & ">" & CStr(objFile.Path) & "</A>""
[tt]strOutput = "<A href=[red]'[/red]" & objFile.Path & "[red]'[/red]>" & objFile.Path & "</A><br />[highlight]"[/highlight][/tt]
 
Thanks tsuji for the post. I made the changes and I'm still not receiving the expected results. I'm receiving a page not found error and the link ends in something I don't recognize (/_derived/nortbots.htm). Do you have any other suggestions. Thanks for your help.

...ecm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top