[mso] Re: Access 2002: Syntax For Double If Statement?
- From: Cathy.Evans@xxxxxxxxx
- To: mso@xxxxxxxxxxxxx
- Date: Fri, 24 Jun 2005 16:07:17 -0400
Thank you, Jim, that works absolutely perfect. I really need to get ahold
of learning the Case statement, you're right, it does seem easier to
understand and more flexible, and I can see what you've done and how it
works compared to If. Sorry for any typos or confusion.
Thank you so much! Cathy
"Jim Pettit"
<jimpettit@xxxxxxxx To: <mso@xxxxxxxxxxxxx>
m>
Sent by: cc:
mso-bounce@freelist
s.org Subject: [mso] Re: Access 2002:
Syntax For Double If
06/24/2005 03:49 PM Statement?
Please respond to
mso
.....
Cathy--
First things first. You wrote: "Tried adding an If [ProjActionDate] Is Not
Null or [ProjActionDate] = "", but don't have it quite right cause then it
does nothing." That's easy to see; you're telling it to do nothing. The
statement:
If [ProjActionDate] Is Not Null or [ProjActionDate] = ""
Do something
End If
...is akin to telling the computer:
If the [ProjActionDate] has a value, or if it *doesn't* have a value
Do something
End If
Anyway, that may just be a type. So, please try this:
Private Sub ProjActionTypeID_FK_AfterUpdate()
Select Case [ProjActionTypeID_FK]
Case "1"
If [ProjActionDate] & "" = "" Then
[ProjActionDate] = Now()
End If
Case "2"
If [ProjActionDate] & "" = "" Then
[ProjActionDate] = Now()
End If
[ProjActionNotes] = "No Commitments"
Case Else
End Select
End Sub
Notes:
1) I've use the 'Select Case' statement; it's very handy, easy
to
understand, and much more flexible for future use.
2) I placed the line '[ProjActionNotes] = "No Commitments"'
outside
the If...Then, as I'm not sure whether you wanted it to execute or not;
change it as you see fit.
3) Your code contained an extra 'End If'; I left it out, as it
seemed like a type.
--Jim
-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain proprietary,
business-confidential and/or privileged material.
If you are not the intended recipient of this message you
are hereby notified that any use, review, retransmission,
dissemination, distribution, reproduction or any action taken
in reliance upon this message is prohibited. If you received
this in error, please contact the sender and delete the
material from any computer. Any views expressed in this message
are those of the individual sender and may not necessarily reflect
the views of the company.
-------------------------------------------------------------------------------------------------------
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
Other related posts: