I copied ReqResearch from your original post. If that is not the actual
name
of the field as you see it in the All Fields tab, correct the formula to
use
the correct field name. The field name needs to be in brackets.
I'm so sorry for being a pain...but I don't understand. Originally, I
went
to ViewCode in the File Menu, and input your Function_Item code. It
wasn't
working, which is why I gave you the field names that I was working
with.
Then you mentioned I didn't need code, all I need was to enter a
formula
in
the Validation box of (DataResearch). I input exactly what you put
down
([ReqResearch] <> "Required") and got an "Unknown Field" error. So I
thought
you meant to actually input a formula with the expression
([ReqResearch]
<>
"Required"). So, that's where that IIf statement below came from.
:
Why didn't you try the formula I suggested? Yours won't work. A
validation
formula must return True if the data is "good" and False if it isn't.
message
Oh. I should've thought of that. Thank you. I input the following
formula
into the Validation box: IIf([ReqResearch]="Required",<>"") -- So
now
I'm
getting an error saying the value I entered into the field is not
valid.
Even if [ReqResearch] <>"Required" I still get the same message.
Did I
do
something wrong?
:
You don't need code for that. You can do it with a validation
formula
on
the
control that displays DataResearch:
([ReqResearch] <> "Required") OR ([DataResearch] <> "")
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
message
Thanks for the quick response Sue. If you remember me from
OutlookCode.com,
I'm not very good with Code. That looks like it'll work. Let me
give
you
the specific details and maybe you can help me a bit further. I
have a
field
(ReqResearch) that populates with a value of "Required" when a
certain
Check
Box is checked. When that is true, I want another field,
(DataResearch)
to
be required. In other words, If (ReqResearch) = "Required", then
(DataResearch) cannot be "". Can you help me fix that, please?
Thank
you
so
very much.
:
Function Item_Write()
If Item.UserProperties("Your prop") = "" Then
Item_Write = False
MsgBox "Fill in the YOUR PROP field."
End If
End Function
message
How do I utilize a "Cancel Action on Save" script, to cancel
the
action
of
saving a contact form if a certain field is null. I have a
Custom
Form,
that
labels certain fields as required based on the value of
another
field.
I
would like these fields "labelled" as required to actually be
required.
So,
I was thinking that if one of these "required" fields is null
when
the
user
tries to save the contact form, an error message can pop up
saying
which
required field needs to be populated. I was told to try a
"Cancel
Action"
action OnSave if...something. Can anyone help?