Multiple null fields

A

Arlend Floyd

Here what im trying to do. If any of the three Text fields are null then
display msgbox. It works fine with just one text box, but I can’t seem to
understand how to look at three text fields. What’s the proper way to use
multiple fields?

If IsNull([Text65] Or [Text67] Or [Text69]) Then

intSave = MsgBox("Are you sure you want to go to a new customer without
inputing a Action?", vbYesNo + vbQuestion + vbDefaultButton2, "Save
Confirmation")
If intSave = vbYes Then

DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
Else
DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
 
J

Jeanette Cunningham

If IsNull([Text65] Or IsNull([Text67]) Or IsNull([Text69]) Then

Jeanette Cunningham
 
A

Arlend Floyd

Thanks works fine..

Jeanette Cunningham said:
If IsNull([Text65] Or IsNull([Text67]) Or IsNull([Text69]) Then

Jeanette Cunningham

Arlend Floyd said:
Here what im trying to do. If any of the three Text fields are null then
display msgbox. It works fine with just one text box, but I can't seem to
understand how to look at three text fields. What's the proper way to use
multiple fields?

If IsNull([Text65] Or [Text67] Or [Text69]) Then

intSave = MsgBox("Are you sure you want to go to a new customer without
inputing a Action?", vbYesNo + vbQuestion + vbDefaultButton2, "Save
Confirmation")
If intSave = vbYes Then

DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
Else
DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
 
D

Douglas J. Steele

Alternatively, since using + as a concatenation character propagates Nulls,
you could use

If IsNull([Text65] + [Text67] + [Text69]) Then

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jeanette Cunningham said:
If IsNull([Text65] Or IsNull([Text67]) Or IsNull([Text69]) Then

Jeanette Cunningham

Arlend Floyd said:
Here what im trying to do. If any of the three Text fields are null then
display msgbox. It works fine with just one text box, but I can't seem to
understand how to look at three text fields. What's the proper way to use
multiple fields?

If IsNull([Text65] Or [Text67] Or [Text69]) Then

intSave = MsgBox("Are you sure you want to go to a new customer without
inputing a Action?", vbYesNo + vbQuestion + vbDefaultButton2, "Save
Confirmation")
If intSave = vbYes Then

DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
Else
DoCmd.Close
DoCmd.OpenForm "FrmCustSearch"
End If
 

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

Top