Assuming a test form with a standard, non-themed grid called 'Grid1' and
bound to a table called 'celu', with the leftmost column in the grid
bound to a field called 'stock_code', adding this code to a button will
give you the top and bottom visible stock codes. From that you can
presumably extract a cursor from the data and report on the cursor.

You may have to fiddle with offsets depending on your own grid.

Note: This code is fairly quick & filthy and needs error checking etc.

        
        * --  x = horizontal, y=vertical
        lnRowout = 0
        lnColout = 0
        lnViewout = 0

        lnTopY = thisform.grid1.Top + thisform.grid1.HeaderHeight + 10
        lnTopX = thisform.grid1.Left + 20

        lnBottomY = thisform.grid1.Top + Thisform.grid1.Height - 20
        lnBottomX = thisform.grid1.Left + 20
        
        * -- Get top row. '3' means we're looking for a cell.
        Thisform.grid1.GridHitTest(lnTopX, lnTopY, 3, @lnRowout,
        @lnColout, @lnViewout)
        thisform.PSet(1, lnTopY)                                       
        && -- For visual test only.
        Thisform.grid1.ActivateCell(lnRowOut, lnColOut) 
        lcStartCode = celu.stock_code                           && --
        celu.stock_code being the field that the first column is bound
        to.

        Thisform.grid1.GridHitTest(lnBottomX, lnBottomY, 3, @lnRowout,
        @lnColout, @lnViewout)
        thisform.PSet(1,lnBottomY)                                     
        && -- For visual test only.
        Thisform.grid1.ActivateCell(lnRowOut, lnColOut) 
        lcEndcode = celu.stock_code                             
        
        
        Debugout 'Start:' + lcStartcode + ' ' + 'End:' + lcEndcode
        
        
        





-- 
  Alan Bourke
  alanpbourke (at) fastmail (dot) fm


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/1337951184.20366.140661080581573.69887...@webmail.messagingengine.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to