List Box

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
===============
 
K

Ken Snell \(MVP\)

Which version of ACCESS are you trying to use? On which code line does the
error occur?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top