Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

Invalid use of null error!

$
0
0
The function below contains the error. The bold line is producing the error. How can I change that around to avoid an error?

Private Sub FillValueList(ValueList As SSValueList, FillGrid As SSUltraGrid, ListName As String, ListRST As ADODB.Recordset, ValueFieldName As String, ListFieldName As String, Optional StringID As Boolean = False)
Dim i As Integer


ListRST.MoveFirst

If FillGrid.ValueLists.Exists(ListName) Then
Set ValueList = FillGrid.ValueLists(ListName)
ValueList.ValueListItems.Clear
Else
Set ValueList = FillGrid.ValueLists.Add(ListName)
End If

Do Until ListRST.EOF
If StringID Then
ValueList.ValueListItems.Add CStr(ListRST.Fields(ValueFieldName)), ListRST.Fields(ListFieldName)
Else
ValueList.ValueListItems.Add CLng(ListRST.Fields(ValueFieldName)), ListRST.Fields(ListFieldName)
End If
ListRST.MoveNext
Loop
End Sub

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>