VB to move text from one list box to another?

  livewire 15:06 07 May 08
Locked

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 08

Untested but have you tried

lst2.AddItem lst1.List(lst1.Value)

  livewire 09:58 15 May 08

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
Else
lst2.AddItem (lst1.Value)
End If
End Sub

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

Surface Pro (2017) vs Surface Pro 4

Where HTML5 is headed next

MacBook Pro v Surface Pro 5