Hello,
I needed to update some calculations in an legacy program; I did my updates in one procedure, but when trying to compile the code, another procedure (see code below) gave an error message saying 'Method or data member not found' for 'ListItem' in this part 'lstSELINV.ListItems.Count' where lstSELINV is a ListBox (no changes there).
Any idea, please?
I needed to update some calculations in an legacy program; I did my updates in one procedure, but when trying to compile the code, another procedure (see code below) gave an error message saying 'Method or data member not found' for 'ListItem' in this part 'lstSELINV.ListItems.Count' where lstSELINV is a ListBox (no changes there).
Code:
Private Sub cmdISEL_Click()
Dim I
On Error GoTo NAV1
For I = 1 To lstSELINV.ListItems.Count
Set lstSELINV.SelectedItem = lstSELINV.ListItems(I)
If lstSELINV.SelectedItem = (Format(RSACCESS.Fields(0).Value, "000")) Then
MsgBox "Invoice " & Format(RSACCESS.Fields(0).Value, "000") & " already added!"
Exit Sub
End If
Next I
Label18.Caption = Label18.Caption + 1
Set lstmain2 = Me.lstSELINV.ListItems.Add(, , Format(RSACCESS.Fields(0).Value, "000"))
cmdPREVIOUS_Click
NAV1:
End Sub
Any idea, please?