Move Cursor to specific record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmurgia
    New Member
    • May 2008
    • 63

    Move Cursor to specific record

    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.AbsolutePos ition 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.AbsolutePos ition 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
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    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

    Comment

    • rmurgia
      New Member
      • May 2008
      • 63

      #3
      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:

      Code:
         strSQL = "SELECT Make,ModelSeries,Area,MFP,Supported"
         strSQL = strSQL & " FROM u_vPSLAreaMaintExceptions"
         strSQL = strSQL & " Make >= '" & strMake & "' And "
         strSQL = strSQL & " ModelSeries >= '" & strModelSeries	
        
         rec.Open strSQL, conn 
      
        Do While not rec.EOF 
          Response.Write "<tr class='leftcol'>"  
          Response.Write "<td colspan=""7"">" & rec("Make") & " </td>"
          Response.Write "<td colspan=""10"">" & rec("ModelSeries") & " </td>"
          Response.Write "<td colspan=""3"">" & rec("MFP") & " </td>"
      </td>"
          Response.Write "</tr>"    
          rec.MoveNext	
        Loop
      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.

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        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

        Comment

        • rmurgia
          New Member
          • May 2008
          • 63

          #5
          Ok Thanks. I guess I should post this in the Javascipt section.

          Comment

          Working...