I am trying to combine a search.htm and a search.asp file into one file (search.asp) - a search.asp that posts to a search.asp. I have not been able to find an example of what I am trying to do. The form is going to be in an iframe. When the form is submitted, the query results (recordset) and the form will then appear in the same iframe, with the form on top. As separate files, the query works. Not sure how to combine as one though. Any help would be greatly appreciated.<BR><BR>Search.htm<BR><BR>&#060;html&# 062;<BR>&#060;head&#062;&#060;title&#062;&#060;/title&#062;<BR>&#060;script language="Javascript"&#062;<BR>&#060;!--<BR>function checkForm() {<BR>returnValue = false;<BR>if (document.form.STitle.value == "") {<BR>alert("You must fill out the form.");<BR>document.form.STitle.focus();<BR>} else {<BR>returnValue = true;<BR>}<BR>return returnValue;<BR>}<BR>//--&#062;<BR>&#060;/script&#062;<BR>&#060;/head&#062;<BR>&#060;body&#062;&#060;form name=form method=POST action="search.asp" onSubmit="return checkForm(this)"&#062;<BR><BR>&#060;table border="0" width="550" cellpadding="0" cellspacing="0"&#062;<BR>&#060;tr&#062;<BR>&#060;t d width="130"&#062;&#060;b&#062;Title of book:&#060;/b&#062;&#060;/td&#062;<BR>&#060;td width="230"&#062;&#060;input TYPE="TEXT" NAME="STitle" SIZE="30"&#062;&#060;/td&#062;<BR>&#060;td width="190"&#062;&#060;input TYPE="submit" VALUE="Search"&#062;&nbsp;&nbsp; &#060;input type="reset" value="Clear"&#062;&#060;/td&#062;&#060;/tr&#062;<BR>&#060;/table&#062;<BR>&#060;/form&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>Search.asp<BR><BR>&#060;%<BR>If Request.QueryString("Move") = "Next" Then<BR>Session("CurrentPage") = Session("CurrentPage") + 1<BR>End If<BR><BR>If Request.QueryString("Move") = "Pref" Then<BR>Session("CurrentPage") = Session("CurrentPage") - 1<BR>End If<BR><BR>If Request.QueryString("Move") = "" Then<BR>Call MakeSQL<BR>Session("CurrentPage") = 1<BR>End If<BR><BR>Dim dbConn<BR>Set dbConn = Server.CreateObject("ADODB.Connection")<BR>dbConn. Open "DSN=books"<BR><BR>Dim rsRecords<BR>Set rsRecords = Server.CreateObject("ADODB.Recordset")<BR><BR>rsRe cords.Open Session("SQLString"), dbConn, 3, 1<BR><BR>strRecordCount = rsRecords.RecordCount<BR><BR>If strRecordCount &#060; 1 then<BR>response.write("&#060;p align=center&#062;&#060;font size=12&#062;&#060;b&#062;No records found in the database&#060;/b&#062;&#060;/font&#062;&#060;/p&#062;")<BR>Else<BR><BR>rsRecords.PageSize = 5<BR>rsRecords.AbsolutePage = Session("CurrentPage")<BR><BR>Dim TotalPages<BR>TotalPages = rsRecords.PageCount<BR>%&#062;<BR><BR>&#060;HTML&# 062;&#060;HEAD&#062;&#060;TITLE&#062;&#060;/TITLE&#062;<BR>&#060;script language="JavaScript"&#062;<BR>&#060;!--<BR>function openWindow(url, name) {<BR> window.open(url, name, "width=700,height=150,top=50,left=50");<BR>}<B R>//--&#062;<BR>&#060;/script&#062;<BR>&#060;/HEAD&#062;<BR>&#060;BODY&#062;<BR>&#060;table width="575"&#062;&#060;tr&#062;&#060;td&#062;<BR>< BR>&#060;%<BR>If strRecordCount &#062; 0 Then<BR>Response.Write ("&#060;font size=2&#062;&#060;b&#062;Records found: " & strRecordCount & "&#060;/b&#062;&#060;/font&#062;")<BR>End if<BR>%&#062;<BR><BR>&#060;/td&#062;&#060;td align=right&#062;<BR><BR>&#060;%<BR>Response.Write ("&#060;font size=2&#062;&#060;b&#062;Page " & Session("Currentpage") & " of " & TotalPages & "&#060;/b&#062;&#060;/font&#062;")<BR>%&#062;<BR><BR>&#060;/td&#062;&#060;/tr&#062;&#060;/table&#062;<BR>&#060;table width=1 width="575"&#062;<BR>&#060;tr&#062;&#060;td&#062;& #060;font size=2&#062;&#060;b&#062;Details&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR>&#060;td&#062;&#060;font size=2&#062;&#060;b&#062;Authors&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR>&#060;td&#062;&#060;font size=2&#062;&#060;b&#062;Title&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;<BR>&#060;td&#062;&#060;font size=2&#062;&#060;b&#062;Have?&#060;/b&#062;&#060;/font&#062;&#060;/td&#062;&#060;/tr&#062;<BR>&#060;TR&#062;<BR><BR>&#060;%<BR>Do While Not rsRecords.EOF And NumRows &#060; rsRecords.PageSize<BR>%&#062;<BR><BR>&#060;%<BR>If rsRecords("Key")&#060;&#062;"" Then<BR>response.write("&#060;td valign=top&#062;&#060;font size=2&#062;&#060;a href=javascript:openWindow(&#039details.asp?Key=" & rsRecords("Key") & "&#039)&#062;Details&#060;/a&#062;&#060;/font&#062;&#060;/td&#062;")<BR>End If<BR>%&#062;<BR> <BR>&#060;%<BR>sAuthors="&nbsp;" & rsRecords("Authors")<BR>If sAuthors&#060;&#062;"" Then<BR>response.write("&#060;td valign=top&#062;&#060;font size=2&#062;" & sAuthors & "&#060;/font&#062;&#060;/td&#062;")<BR>End If<BR>%&#062;<BR> <BR>&#060;%<BR>sTitle="&nbsp;" & rsRecords("Title")<BR>If sTitle&#060;&#062;"" Then<BR>response.write("&#060;td valign=top&#062;&#060;font size=2&#062;" & sTitle & "&#060;/font&#062;&#060;/td&#062;")<BR>End If<BR>%&#062;<BR> <BR>&#060;%<BR>sHave="&nbsp;" & rsRecords("Have?")<BR>If sHave&#060;&#062;"" Then<BR>response.write("&#060;td valign=top&#062;&#060;font size=2&#062;" & sHave & "&#060;/font&#062;&#060;/td&#062;")<BR>End If<BR>%&#062;<BR><BR>&#060;/tr&#062;<BR><BR>&#060;%<BR>NumRows = NumRows + 1<BR>rsRecords.MoveNext<BR>Loop<BR>%&#062;<BR><BR> &#060;/TABLE&#062;<BR>&#060;table width="575"&#062;&#060;tr&#062;&#060;td&#062;<BR>< BR>&#060;%<BR>If Session("CurrentPage") &#062; 1 Then<BR>response.write("&#060;a href = search.asp?Move=Pref&#062;Previous Page&#060;/a&#062;")<BR>End If<BR>%&#062;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<BR><BR>&#060;%<BR>If Session("CurrentPage") &#060; rsRecords.PageCount Then<BR>response.write("&#060;a href = search.asp?Move=Next&#062;Next Page&#060;/a&#062;")<BR>End If<BR>%&#062;<BR><BR>&#060;/td&#062;&#060;td align="right"&#062;<BR>&#060;font size="2"&#062;H = Hardcover, S = Softcover, P = Pocket, XL = Ex-library&#060;/font&#062;&#060;/td&#062;&#060;/tr&#062;&#060;/table&#062;<BR><BR>&#060;%<BR>End If<BR>rsRecords.Close<BR>Set RsRecords = nothing<BR>dbConn.Close<BR>Set dbConn = nothing<BR>%&#062;<BR><BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR><BR>&#060;%<BR>Sub MakeSQL<BR><BR>Session("CurrentPage") = ""<BR>Session("SQLString") = ""<BR><BR>Dim strBooksTable<BR>Dim strTitleColumn<BR>Dim strOrderByKeyColumn<BR>Dim strTitleText<BR><BR>strTitleColumn = "Title"<BR>strBooksTable = "baseballbooks"<BR>strOrderByKeyColumn = "key"<BR>strTitleText = Request("STitle")<BR>strTitleText = Replace(strTitleText, "&#039", "&#039&#039")<BR><BR>Dim i<BR>Dim WordCounter<BR>For i = 1 to len(strTitleText)<BR> If mid(strTitleText, i, 1) = " " Then <BR> WordCounter = WordCounter + 1<BR> End If<BR>Next<BR><BR>WordCounter = WordCounter + 1<BR><BR>Dim Word(100)<BR><BR>Dim CurrentWord<BR>CurrentWord = 1<BR>For i = 1 to len(strTitleText)<BR> If mid(strTitleText, i, 1) = " " Then<BR> CurrentWord = CurrentWord + 1<BR> Else<BR> Word(CurrentWord) = Word(CurrentWord) + mid(strTitleText, i, 1)<BR> End If<BR>Next<BR><BR>Dim SQL<BR>SQL = "SELECT * FROM "& strBooksTable &" WHERE "<BR><BR>Dim SQL1<BR>For i = 1 to WordCounter<BR> If i &#060;&#062; WordCounter Then<BR> SQL1 = SQL1 & strTitleColumn & " LIKE &#039%" & Word(i) & "%&#039 AND "<BR> ElseIf i = WordCounter Then<BR> SQL1 = SQL1 & strTitleColumn & " LIKE &#039%" & Word(i) & "%&#039"<BR> End If<BR>Next<BR> <BR>if Len(strOrderByKeyColumn) &#062; 0 then<BR> SQL = SQL & SQL1 & " ORDER BY " & strOrderByKeyColumn<BR>Else<BR> SQL = SQL & SQL1<BR>End If<BR><BR>Session("SQLString") = SQL<BR>End Sub<BR>%&#062;