You have declared FillListView as,
The third parameter, ImgNum, is optional. You may omit it.VB Code:
Sub FillListView(lstStocks As ListView, rsStocks As ADODB.Recordset, Optional ImgNum As Long = 0)
But the first 2 parameters are NOT optional. You must pass them to the procedure.
But you aren't pasing anything to it in your call in Form_Load
You should call it like,
VB Code:
Call FillListView lstStocks, rsStocks 'the third parameter is Optional
Or,
as both the listview and the recordset are in same scope, you can change the definition like,
and then, your current call will work.VB Code:
Sub FillListView(Optional ImgNum As Long = 0)




Reply With Quote