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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to Record: Jump to a specific record

Status
Not open for further replies.

marvelisticme

Technical User
Feb 3, 2005
70
US
The standard "Move to Record" recordset navigation bar only displays four commands:

First, previous, next, last.

I want to add a "Go To" field in the middle. I can already get the text box in there, but any ideas on how to actually make it jump to the record requested in the box?

Thanks for any ideas!!!
 
Thanks for the reply, Chris, but I'm not savvy enough to just fit that in. How would that look in this code block????? The text box is named recordchoice (see ****). Thank you very much for your help!

<!--DWLayoutTable-->
<tr>
<td height="37" width="79" class="FieldTitles"><div
align="right"></div></td>
<td width="428">
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>"><img src="First.gif"
border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>

<td width="31%" align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>"><img src="Previous.gif"
border=0></a>
<% End If ' end MM_offset <> 0 %>
</td>
**************
<td width="23%" align="center">
<form name="form1" method="post" action="">
<input name="recordchoice" type="text" id="recordchoice"
value="Go To" size="8" maxlength="5">
</form>
</td>
**************
<td width="23%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>"><img src="Next.gif"
border=0></a>
<% End If ' end Not MM_atTotal %>
</td>

<td width="23%" align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>"><img src="Last.gif"
border=0></a>
<% End If ' end Not MM_atTotal %>
</td>
</tr>
</table>
 
Code:
dim RecNo
if request.form("recordchoice") <> "" then
RecNo = CInt(request.form("recordchoice"))
objRS.Move(RecNo,adBookmarkFirst)
end if

with checks for out of range numbers of course

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top