Code for a Null value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some code on a data entry form that looks like this....

Private Sub Issues_AfterUpdate()
If Me.[Issues].Value = "Other" Then
Me.[IssuesFound].Value = -1

End If
End Sub

If Issues is Null I want the value in IssuesFound to be "No" (this is a
checkbox). How do I code this?
 
Private Sub Issues_AfterUpdate()
If IsNull(Me.[Issues].Value) Then
Me.[IssuesFound].Value = 0
ElseIf Me.[Issues].Value = "Other" Then
Me.[IssuesFound].Value = -1
End If
End Sub
 
Thanks so much; this was very helpful. Now all I need is for an answer to my
"How to disable data entry fields" question (7 posts below this one). Do you
think you could give me an answer Doug?
 

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

Back
Top