Re: additem removeitem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Try removing them the in reverse order...

For X = .lst_map_prop_for_trans.ListCount - 1 To 0 Step -1

Rick


"BigPig" <BigPig@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:66001489-809A-41CC-B233-49887C98A613@xxxxxxxxxxxxxxxx
Hi All,

Can't figure out why the following script won't remove selected items
properly:

With frm_map

Dim X As Integer
For X = 0 To .lst_map_prop_for_trans.ListCount - 1
On Error Resume Next
If .lst_map_prop_for_trans.Selected(X) = True Then
.lst_map_trans_to.AddItem .lst_map_prop_for_trans.List(X, 0)
.lst_map_trans_to.List(.lst_map_trans_to.ListCount - 1, 0) =
.lst_map_prop_for_trans.List(X, 0)
.lst_map_trans_to.List(.lst_map_trans_to.ListCount - 1, 1) =
.lst_map_prop_for_trans.List(X, 1)
.lst_map_trans_to.List(.lst_map_trans_to.ListCount - 1, 2) =
.lst_map_prop_for_trans.List(X, 2)
.lst_map_trans_to.List(.lst_map_trans_to.ListCount - 1, 3) =
.lst_map_prop_for_trans.List(X, 3)
.lst_map_prop_for_trans.RemoveItem (X)
End If

Next X
X = X + 1

End With

Other info: both listboxes are in separate frames (in the same form) and are
set to multiselect. The issue is that when I select one item to "transfer" it
works, but with two or more items selected the first or half of the items
selected will move, but not the second or second half of the items selected.

Any and all advice would be greatly appreciated.

Thank you.

.



Relevant Pages

  • RE: export user accounts from NT 4.0 domain
    ... ATTENTION THE SCRIPT MUST BE RUNNED FROM A COMPUTER WHERE EXCEL IS ... from the information in a Microsoft Excel spreadsheet. ... Dim strLast, strFirst, strMiddle, strPW, intRow, intCol ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • Re: Password Expire
    ... We have one fron end Edge server in our DMZ which passes email onto two ... I used to schedule a script to run every 24 hours on my Exchange 2003 ... Dim fso, txtarray, BodyText ... Call ProcessFolder (objContainer, numDays) ...
    (microsoft.public.exchange.admin)
  • Re: Collecting output generated via one spreadsheet into a new spreasheet
    ... A quick read of the script indicates that it makes no attempt to actually write out any of the information is has found. ... 'Call Output sub ... I would hazard a guess that if the output contains only the info associated with the last record from the input file, that you are failing to increment the row counter associated with the output spreadsheet after writing to it. ... Dim strUserName, objUserDomain, objGroup, objUser, strGroupList ...
    (microsoft.public.scripting.vbscript)
  • Re: LDAP query information
    ... a "Dim" statement. ... execution of the script. ... ' Filter on computer object. ... ' Construct LDAP syntax query. ...
    (microsoft.public.windows.server.scripting)
  • Re: ADSI Problem
    ... Right I've got the script working now with my ASP applications by passing the ... If you are doing forms authentication using ADSI (which it sounds like you ... Restarting IIS usually gets it working again. ... Dim strUserName ...
    (microsoft.public.windows.server.active_directory)