By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

Move Cursor to specific record

P: 63
I create a form which displays records in a list and allows the user to click on the last field of each record to update it. After the record is updated, the form is refreshed. The problem is as follows:

Let's say there are 5 records dislayed as listed below. By clicking REP on Model A, the field Supported is changed from Y to N. After the form is refreshed, it displays properly, but the cursor does not stay on the record worked on. If there are 100 records, it creates a problem for the user who will have to continually scroll to the next record. In MS Access let's say the record was called rec, I could check the rec.AbsolutePosition of the selected record, store it in a variable say recpos and then use the command rec.Move recpos to move to the record after the form is refreshed. When I did this on the web, the rec.AbsolutePosition always returned -1. Is there a way to accomplish this?

Area Model Supported
Area A Model A Y REP
Area B Model B Y REP
Area C Model C Y REP
Area D Model D Y REP
Area E Model E Y REP
Apr 25 '12 #1

✓ answered by jhardman

oh, I gotcha. the easiest way is with javascript. remember, ASP is executed on the server, if you want the screen to interact with the user, you have to do something on their pc - so javascript is going to be the way to go.

Jared

Share this Question
Share on Google+
4 Replies


jhardman
Expert 2.5K+
P: 3,405
look into the cursor type, but even then I'm not sure you can keep your place from one screen refresh to the next.

Jared
May 2 '12 #2

P: 63
Jared,

Thanks for the reply. Actually, when I said cursor, I meant the mouse pointer on the screen. The user can only update one of the fields on this screen called Supported, to indicate if a particular make and model series is supported. The update works fine but when the screen is redisplayed, we have and issue. Here is the code used after the user updates the data to re-display the screen:

Expand|Select|Wrap|Line Numbers
  1.    strSQL = "SELECT Make,ModelSeries,Area,MFP,Supported"
  2.    strSQL = strSQL & " FROM u_vPSLAreaMaintExceptions"
  3.    strSQL = strSQL & " Make >= '" & strMake & "' And "
  4.    strSQL = strSQL & " ModelSeries >= '" & strModelSeries    
  5.  
  6.    rec.Open strSQL, conn 
  7.  
  8.   Do While not rec.EOF 
  9.     Response.Write "<tr class='leftcol'>"  
  10.     Response.Write "<td colspan=""7"">" & rec("Make") & " </td>"
  11.     Response.Write "<td colspan=""10"">" & rec("ModelSeries") & " </td>"
  12.     Response.Write "<td colspan=""3"">" & rec("MFP") & " </td>"
  13. </td>"
  14.     Response.Write "</tr>"    
  15.     rec.MoveNext    
  16.   Loop
  17.  
If a user enters a particular Make and ModelSeries all records equal to or greater than that record will display. This works okay, but what we would like to be able to do is display all of the records and just move the pointer to the last record entered. I believe in MS Access, the code would be rec.Move along with the number. Would that be possible in VBScript? Thanks.
May 3 '12 #3

jhardman
Expert 2.5K+
P: 3,405
oh, I gotcha. the easiest way is with javascript. remember, ASP is executed on the server, if you want the screen to interact with the user, you have to do something on their pc - so javascript is going to be the way to go.

Jared
May 4 '12 #4

P: 63
Ok Thanks. I guess I should post this in the Javascipt section.
May 4 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.