Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Chris Chamberlain
  Where is Chris Chamberlain?
 GL6 0PN
 United Kingdom
 Chris Chamberlain
 To: Muhammed Shafraz
  Where is Muhammed Shafraz?
 Colombo
 Sri Lanka
 Muhammed Shafraz
 Tags
Subject: RE: Select Multiple records by clicking Shif
Thread ID: 265087 Message ID: 268892 # Views: 31 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, July 15, 2010 8:56:24 AM         
   


> >
> > Take a look at the code here for ideas
> >
> > https://www.foxite.com/faq/default.aspx?id=3
> >
> > Chris
> >
> > www.motrac.co.uk
> > www.pdfcommander.com
>
> Dear Chris,
> Thanks for the previous code.
> Please advice me on following case.
> The RecordSource is indexed and cannot be removed. Get it from a SELECT – SQL is impossible as i have to change the code in many areas in exe.
> I need only shift + click followed by shift + click will selecting a block of records to be done.
> i.e I have implemented only the following code in mSelectedRecords()
> IF GetKeyState(VK_lSHIFT)< 0 OR GetKeyState(VK_lSHIFT) > 1
> DO CASE
> CASE .nLastRow > .nActiveRow
> .nRecs2Change = .nLastRow - .nActiveRow
> REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
> FOR i = 1 TO .nRecs2Change
> REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
> SKIP IN (lcRecordSource)
> ENDFOR
> CASE .nLastRow < .nActiveRow
> .nRecs2Change = .nActiveRow - .nLastRow
> REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
> GO .nLastRow IN (lcRecordSource)
> FOR i = 1 TO .nRecs2Change
> REPLACE (lcSelected) WITH .T. IN (lcRecordSource)
> SKIP IN (lcRecordSource)
> ENDFOR
> ENDCASE
> ENDIF
>
> As I have indexed the recordsource this is not working as expected.
> Some times it is selecting other records which are not to be selected.
>
> Can you help me on the above task ?
>
> Thanks in Advance

Muhammed

Sorry I can't help you with your issue with this particular FAQ - started where you are with an indexed recordsource, tried to get it to work reliably, gave up and started again.

The code posted will not work properly with an indexed recordsource, hence the advice in the FAQ to only use a SELECT... statement.

I appreciate there may be a lot of work for you in providing alternative recordsources but for you to utilise this particular FAQ, I don't believe you have any choice.

Cetiz Basoz has also written a FAQ on the same topic which I believe may be available at www.universaltread.com

I am sure he or someone else may be able to advise you where it may be found.

Chris

www.motrac.co.uk
www.pdfcommander.com

ENTIRE THREAD

Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 5:51:54 AM
RE: Select Multiple records by clicking Shif Posted by Samir H. @ 6/18/2010 6:45:15 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 6:50:28 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 6/18/2010 8:07:28 AM
RE: Select Multiple records by clicking Shif Posted by Jun Tangunan @ 6/18/2010 8:37:42 AM
RE: Select Multiple records by clicking Shif Posted by tushar @ 6/18/2010 8:58:54 AM
RE: Select Multiple records by clicking Shif Posted by Yousfi Benameur @ 6/18/2010 11:39:02 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 6/18/2010 2:50:33 PM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 6:53:43 AM
RE: Select Multiple records by clicking Shif Posted by Chris Chamberlain @ 7/15/2010 8:56:24 AM
RE: Select Multiple records by clicking Shif Posted by Muhammed Shafraz @ 7/15/2010 9:07:27 AM
RE: Select Multiple records by clicking Shif Posted by Cetin Basoz @ 7/15/2010 12:46:56 PM
RE: Select Multiple records by clicking Shif Posted by Tony Vignone @ 7/15/2010 6:30:00 PM