J
John E.
I have a custom form for Contacts that has a list box on the 1st page into
which I am reading data from an Excel spreadsheet. Was trying to use the
Join function to do this per pgs 108-109 of Sue's book but can't get past a
run time error on the line that has comment relative to
objItem.lstVisitRequest list box in below code. Can anyone advise me why
this isn't working? Run time error given for this line is #5: Invalid
procedure call or argument, yet it is done in same way as Sue's book.
intRowCount = objRange.Rows.Count
If intRowCount > 0 Then
For Each m_objItem In m_objCurrentFolder.Items
m_strCategories = m_objItem.Categories
If InStr(m_strCategories, "International") > 0 Then
lstVisitRequests.ColumnCount = 4
Dim arrVisitRequests(ListBoxRows, 3)
Dim arrList(ListBoxRows, 3)
For I = 0 To intRowCount
arrVisitRequests(I, 0) = objRange.Cells(I + 1, 1)
arrVisitRequests(I, 1) = objRange.Cells(I + 1, 2)
arrVisitRequests(I, 2) = objRange.Cells(I + 1, 3)
arrVisitRequests(I, 3) = objRange.Cells(I + 1, 4)
Next
' Fill the List Box from the loaded array.
lstVisitRequests.List() = arrVisitRequests
' Fill the List Box in the current contact item
m_objItem.lstVisitRequests = Join(arrVisitRequests, ",")
' above line has run time error
m_objItem.Save
End If
Next
End If
which I am reading data from an Excel spreadsheet. Was trying to use the
Join function to do this per pgs 108-109 of Sue's book but can't get past a
run time error on the line that has comment relative to
objItem.lstVisitRequest list box in below code. Can anyone advise me why
this isn't working? Run time error given for this line is #5: Invalid
procedure call or argument, yet it is done in same way as Sue's book.
intRowCount = objRange.Rows.Count
If intRowCount > 0 Then
For Each m_objItem In m_objCurrentFolder.Items
m_strCategories = m_objItem.Categories
If InStr(m_strCategories, "International") > 0 Then
lstVisitRequests.ColumnCount = 4
Dim arrVisitRequests(ListBoxRows, 3)
Dim arrList(ListBoxRows, 3)
For I = 0 To intRowCount
arrVisitRequests(I, 0) = objRange.Cells(I + 1, 1)
arrVisitRequests(I, 1) = objRange.Cells(I + 1, 2)
arrVisitRequests(I, 2) = objRange.Cells(I + 1, 3)
arrVisitRequests(I, 3) = objRange.Cells(I + 1, 4)
Next
' Fill the List Box from the loaded array.
lstVisitRequests.List() = arrVisitRequests
' Fill the List Box in the current contact item
m_objItem.lstVisitRequests = Join(arrVisitRequests, ",")
' above line has run time error
m_objItem.Save
End If
Next
End If