I know this is going to be a silly one, but...!
I've got:
Dim Rs As DAO.RecordSet
Dim sStored As String
...(open record set etc.)
sBatchIDStored = Rs("fld1").Value
but if the field happens to be empty I get a "Invalid use of Null".
So I try to trap this with:
If RsProc(sFld).Value <> Null Then
sBatchIDStored = Rs(sFld).Value
End If
but then even if the field has something in it, the If doesn't catch it and the assignment is skipped.
I also tried
If RsProc(sFld).Value Is Null Then...
but that throws 424 "Object required".
I'm a seasoned C programmer and can't believe I'm having this much trouble with a simple assignment! What am I doing wrong?
I've got:
Dim Rs As DAO.RecordSet
Dim sStored As String
...(open record set etc.)
sBatchIDStored = Rs("fld1").Value
but if the field happens to be empty I get a "Invalid use of Null".
So I try to trap this with:
If RsProc(sFld).Value <> Null Then
sBatchIDStored = Rs(sFld).Value
End If
but then even if the field has something in it, the If doesn't catch it and the assignment is skipped.
I also tried
If RsProc(sFld).Value Is Null Then...
but that throws 424 "Object required".
I'm a seasoned C programmer and can't believe I'm having this much trouble with a simple assignment! What am I doing wrong?