ADOrs "Invalid Use of Null"
- From: jamesfreddyc <jamesfreddyc@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 18 Jan 2007 11:17:01 -0800
"Invalid Use of Null" Error when null is found on this line:
totcoll_by_speci =
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary!TotCollectedBySpecie
Any tips on how to deal with this?
Thanks,
j
********Full Code:**************
'construct a new ADOrs to populate with Adult Drivers Pct
Dim ADrs As ADODB.Recordset
Set ADrs = New ADODB.Recordset
With ADrs
.fields.Append "Trap", adBSTR
.fields.Append "Specie", adBSTR
.fields.Append "Percentage", adBSTR
.CursorType = adOpenForwardOnly
.LockType = adLockOptimistic
.Open
End With
Dim rsCt As Integer, rsI As Long
Dim xref_summary As String, allspecs_totcoll As Long, dpct As Double,
DriverPct As String
Dim specie_typ As String
Dim totcoll_by_specie As Long
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.Open
datRT_Analysis_AllSpecsTotColl.rsRT_Analysis_AllSpecsTotColl.Open
While Not
datRT_Analysis_AllSpecsTotColl.rsRT_Analysis_AllSpecsTotColl.EOF
xref_summary =
datRT_Analysis_AllSpecsTotColl.rsRT_Analysis_AllSpecsTotColl!xref_id
allspecs_totcoll =
datRT_Analysis_AllSpecsTotColl.rsRT_Analysis_AllSpecsTotColl!AllSpecsTotCollected
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.Filter =
"xref_id = '" & xref_summary & "'"
rsCt =
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.RecordCount
For rsI = 0 To rsCt - 1
specie_typ =
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary!species
totcoll_by_speci =
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary!TotCollectedBySpecie
If allspecs_totcoll = 0 Then Resume Next
dpct = (totcoll_by_speci / allspecs_totcoll) * 100
DriverPct = FormatNumber(dpct, 2, vbUseDefault, vbFalse,
vbUseDefault) & " %"
'add data to ADrs
With ADrs
.AddNew
ADrs!Trap = xref_summary
ADrs!specie = specie_typ
ADrs!Percentage = DriverPct
.Update
End With
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.MoveNext
Next rsI
If Not
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.EOF Then
datRT_Analysis_CollByMo_Summary.rsRT_Analysis_Summary.MoveFirst
End If
datRT_Analysis_AllSpecsTotColl.rsRT_Analysis_AllSpecsTotColl.MoveNext
Wend
.
- Follow-Ups:
- RE: ADOrs "Invalid Use of Null"
- From: jamesfreddyc
- RE: ADOrs "Invalid Use of Null"
- Prev by Date: Re: should left-click decrease, right-click increase a number/CUA/SAA?
- Next by Date: RE: ADOrs "Invalid Use of Null"
- Previous by thread: Re: CAD's identification of an element, How do they do that??
- Next by thread: RE: ADOrs "Invalid Use of Null"
- Index(es):
Relevant Pages
|