VB to move text from one list box to another?

  livewire 15:06 07 May 2008

I cant figure out for the life of me why this doesn't work...

It seems to work ok in VB6 but when I put it into Access 2007 VBA it comes up with some ridiculous error message.

Anyone got any idea what could be the problem here? Its been puzzling me for a while now!!

click here

^^ for screenshot :(

  VoG II 16:17 07 May 2008

Untested but have you tried

lst2.AddItem lst1.List(lst1.Value)

  livewire 09:58 15 May 2008

Hi VoG

Indeed! .AddItem and .Value are the way forward!

The winning code was:

Private Sub cmdMove_Click()
If lst1.ListIndex = -1 Then
Exit Sub
lst2.AddItem (lst1.Value)
End If
End Sub

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

InVision Studio takes on Adobe XD and Sketch

Camera tips to take better iPhone photos

Comment transformer un iPhone en borne Wi-Fi ?