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
 
G

Guest

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top