G
GGill
When i click on button, i have error msg:
"Compile error: Method or data member not found".
Please tell me what is wrong in this code?????
Thank you.
==============
Private Sub btnAdd_Click()
' selected rows from lstAvailable to lstSelected
On Error GoTo Err_btnAdd_Click
Dim varItem As Variant
Dim varValue As Variant
Dim isOk2Add As Boolean
With lstAvailable
For Each varItem In .ItemsSelected
If IsNull(lstSelected.RowSource) Then
isOk2Add = True
Else
isOk2Add = (InStr(1, _
lstSelected.RowSource, _
.Column(0, varItem)) = 0)
End If
If isOk2Add Then
varValue = .Column(0, varItem) & ";" & _
.Column(1, varItem)
lstSelected.AddItem Item:=varValue
End If
Next varItem
End With
LoadAvailable
Exit_btnAdd_Click:
Exit Sub
Err_btnAdd_Click:
MsgBox Err.Description
Resume Exit_btnAdd_Click
End Sub
===============
"Compile error: Method or data member not found".
Please tell me what is wrong in this code?????
Thank you.
==============
Private Sub btnAdd_Click()
' selected rows from lstAvailable to lstSelected
On Error GoTo Err_btnAdd_Click
Dim varItem As Variant
Dim varValue As Variant
Dim isOk2Add As Boolean
With lstAvailable
For Each varItem In .ItemsSelected
If IsNull(lstSelected.RowSource) Then
isOk2Add = True
Else
isOk2Add = (InStr(1, _
lstSelected.RowSource, _
.Column(0, varItem)) = 0)
End If
If isOk2Add Then
varValue = .Column(0, varItem) & ";" & _
.Column(1, varItem)
lstSelected.AddItem Item:=varValue
End If
Next varItem
End With
LoadAvailable
Exit_btnAdd_Click:
Exit Sub
Err_btnAdd_Click:
MsgBox Err.Description
Resume Exit_btnAdd_Click
End Sub
===============