if then statement

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

Guest

I'm trying to write an if then statement where one value is null and the
other is not. This is what I'm trying to write in words:
If name is null and comment is not null then pop up a message box, else
close window.
Thanks for any help you can provide!!
-Jenny
 
If IsNull(Name) Then
If Not IsNull(comment) Then
MsgBox "watever you want to say", VbOkOnly
End If
End If

OR

If IsNull(Name) And Not IsNull(comment) Then
MsgBox "watever you want to say", VbOkOnly
End If

Thanks,
www.dbwiz.com
 
I'm trying to write an if then statement where one value is null and the
other is not. This is what I'm trying to write in words:
If name is null and comment is not null then pop up a message box, else
close window.
Thanks for any help you can provide!!
-Jenny

If IsNull([NameField]) and Not IsNull([Comments]) then
MsgBox "Your message here"
Else
' I don't know what you mean by close the window. What window?
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

Similar Threads


Back
Top