Null value

  • Thread starter EMILYTAN via AccessMonster.com
  • Start date
E

EMILYTAN via AccessMonster.com

I want to check if there is no value return...how should I write this line of
code?

strPartNumber = Nz(DLookup("PartNumber", "Kanban", "PartNumber='" & Me.
txtPartNumber & "'"))


Thanks
 
O

Ofer Cohen

Try

strPartNumber = Nz(DLookup("PartNumber", "Kanban", "PartNumber='" & Me.
txtPartNumber & "'"),0) ' Replacing Null with 0
' Check for zero which mean no record was return
If strPartNumber = 0 Then
MsgBox "No record was found"
End If
 
E

EMILYTAN via AccessMonster.com

Yup..thanks for your help...

Ofer said:
Try

strPartNumber = Nz(DLookup("PartNumber", "Kanban", "PartNumber='" & Me.
txtPartNumber & "'"),0) ' Replacing Null with 0
' Check for zero which mean no record was return
If strPartNumber = 0 Then
MsgBox "No record was found"
End If
I want to check if there is no value return...how should I write this line of
code?
[quoted text clipped - 3 lines]
 
Top