Page 1 of 1

MULTISELECT RECORDSET

Posted: Fri Jun 25, 2021 2:18 pm
by Jack
Hi,
I can use multiselect with xbrowse of recordset
*
How to go to each record select and do Something

What is the syntax ?

wac := oLbx:aSelected

for i = 1 to len (wac)
*** ???
next

Thanks for your help .

Philippe

Re: MULTISELECT RECORDSET

Posted: Sat Jun 26, 2021 3:21 am
by nageswaragunupudi

Code: Select all | Expand


oBrw:lScreenUpdating := .f.
oBrw:Refresh()
//
uSaveBm := oBrw:oRs:BookMark
for i := 1 to Len( oBrw:aSelected )
  oBrw:oRs:BookMark := oBrw:aSelected[ i ]
  // do anything with the current record of the recordset
  // during this loop do not refresh browse
next
oBrw:oRs:BookMark := uSaveBm
//
oBrw:lScreenUpdating := .t.
oBrw:Refresh()
 


Another way:

Code: Select all | Expand


oBrw:lScreenUpdating := .f.
oBrw:Refresh()
//
uSaveBm := oBrw:oRs:BookMark
cFilter := oBrw:oRs:Filter
oBrw:oRs:Filter := oBrw:aSelected
oBrw:oRs:MoveFirst()
do while !oBrw:oRs:Eof()
   // do your work
   oBrw:oRs:MoveNext()
enddo
oBrw:oRs:MoveFirst()
oBrw:Filter := cFilter
oBrw:oRs:BookMark := uSaveBm
//
oBrw:lScreenUpdating := .t.
oBrw:Refresh()
 

Re: MULTISELECT RECORDSET

Posted: Sat Jun 26, 2021 7:59 am
by Marc Venken
oBrw:lScreenUpdating := .F.

First time i see this one...

I suppose it is adviced for the moments that we process xbrowse records like the sample posted here ?

but where is it build for ? are there more situations its use is better ?

Re: MULTISELECT RECORDSET

Posted: Sat Jun 26, 2021 8:59 am
by Jack
Thanks for your help .

Here is the code that work for me .

oRs:Filter := oLbx:aSelected
oRs:MoveFirst()
do while !oRs:Eof()
msgalert(oRs:Fields(1):Value)
oRs:MoveNext()
enddo

Thanks

Philippe