
May 10th, 2000, 12:16 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
<i><b>Originally posted by : coolperson (coolpersona@hotmail.com)</b></i><br /><br />I tried the code, but it does not seem to be working. I am pasting it here. Please do see what<br />could be wrong. Everytime I get an error saying that I have either reached the EOF, or BOF or the<br />current record has been deleted.<br /><br />Code is as follows:<br />---------------<br /><html><br /><head http-equiv="content-type" content="text/html; charset=windows-1252"><br /><title>The Drees Company - Request for Travel Arrangements</title><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /><br /><br /></head><br /><br /><body bgcolor=antiquewhite><br /><font size=3><br /><%<br /><br />'------------------------------------------------------------<br />'opening the data path where the database is located.<br />sDatapath = "Provider=Microsoft.jet.OLEDB.4.0;user ID=Admin;Data Source=" &_<br />"\corp_srvvol1access20data esttravel raveldata.mdb"<br /><br />set conn = server.CreateObject("ADODB.connection")<br />set rs = server.CreateObject("ADODB.recordset")<br />set rsPhone = server.CreateObject("ADODB.recordset")<br /><br />conn.Open sDataPath<br /><br />'----------------------------------------------------------------<br />' determine a query to open the database for dropdown for name.<br /><br />stSQL = "SELECT DISTINCTROW [ID], [LAST NAME] & ' ' & [FIRST NAME] AS NAME, [title] FROM [PhoneList] ORDER BY [last name] & ' ' & [first name];"<br /><br />rs.open stSQL, conn, 1, 3<br /><br />'----------------------------------------------------------------<br />'check if anything has been selected. If not then select the ID of the person.<br />IF request("ddNamePerson")="" THEN<br /> lPrimary = rs("ID")<br />ELSE<br /> lPrimary = clng(request("ddNamePerson"))<br />END IF<br /><br />%><br /><br /><form action ="Dataget.asp" name="DreesTravel" method="post" > <br /><br /><strong>Name: <br /> <SELECT id=NamePerson name=ddNamePerson onchange="PopulateTextbox();" style="HEIGHT: 25px; WIDTH: 235px"> <br /> <OPTION value="Required" selected>---Choose your Name---</OPTION><br /> <!-- the following pulls name from the phonelist table. --><br /> <%<br /> While Not rs.eof<br /> lID = clng(rs("id"))<br /> %><br /> <OPTION VALUE="<%=lID%>"<%if lPrimary = lID then Response.Write " SELECTED"%>><%=rs.Fields("name").Value%><br /> <p>Title: <input type="text" name="txttitle" size="27" id="title<%=rs("ID")%>" value="<%=rs("title")%>" ><br /><br /><br /><br /> <%<br /> rs.MoveNext<br /> wend<br /> %> <br /> <br /> <br /> </SELECT> <br /><br /> <br /><%<br />rs.movefirst<br />While not rs.EOF<br />%><br /><input type ="hidden" id="title<%rs("id")%>" value="<%=rs("title")%>"><br /><p><input type= "submit" value="Submit Results" id=submit1 name=submit1><br /><br /></form><br /> <br /><%<br />rs.MoveNext<br />wend<br />%><br /><br /><%<br />rs.close<br />conn.close<br />set rs.ActiveConnection = nothing<br />set conn = nothing<br /><br />%><br /><br /><br /><br /><br /></BODY><br /></HTML><br /><br /><script language=VBScript><br />sub window_onload<br /> PopulateTextBox<br />end sub<br /><br />sub PopulateTextBox<br /> lID = document.DreesTravel.ddNamePerson.value<br /> document.DreesTravel.txttitle.value = document.all("title" & lID).value<br />end sub<br /><br /></script><br /><br />------------<br />steve at 5/10/2000 7:39:54 AM<br /><br />http://aspfree.com/authors/adrian/combotextboxlinked.asp<br /><br />check this out. <br /><br /><br />------------<br />CoolPerson at 5/9/2000 9:37:01 AM<br /><br />Hi to all of you,<br /><br />I have a drop down box which pulls the names from a table called phonelist.<br />Followed by that I have textboxes for title, branch, div/dept, and phone #. All these have corresponding<br />columns in the table phonelist.<br /><br />What I wanted to ask is as follows:<br /><br />When I select a name from the ddb, that corresponding person's title,<br />branch, div/dept, and phone# should pop up in the respective textboxes. How can I <br />achieve this ? I have been trying different ways, but I seem to have no luck.<br /><br /> I hope that you would be able to help.<br /><br /> What I get is this error as I am enclosing.<br /> "Either BOF or EOF is True, or the current record has been deleted; the<br /> operation requested by the application requires a current record."<br /><br />Thanks,<br />CoolPerson.<br />
|