Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / March 2005

Tip: Looking for answers? Try searching our database.

How to add required fields to an Outlook form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RF Office user - 24 Mar 2005 01:01 GMT
In a form to request that a distribution center not pick a product/products,
I want the alpha-numeric Model # field and the Reason field on each of nine
lines to be a required entry. I have tried Properties such as Validation "A
value is required for this field" but that led to errors in using the
template. Also tried using some formulas but the Model # list and Reason list
is quite extensive and can't be used in an expression such as IIf( expr ,
truepart , falsepart ). So how do I make fields required?
Sue Mosher [MVP-Outlook] - 24 Mar 2005 02:49 GMT
You have to use either a formula or code in the Item_Write event handler.
Think about what you'll accept as "good" data and what other constraints
(such as a combo box with a match required) are operating on those fields.

FYI, IIf() is almost never used in validation formulas, which must evaluate
to either True or False. If these fields are text fields, you can use this
formula on each one:

   [FieldName] <> ""

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> In a form to request that a distribution center not pick a
> product/products,
[quoted text clipped - 7 lines]
> is quite extensive and can't be used in an expression such as IIf( expr ,
> truepart , falsepart ). So how do I make fields required?
RF Office user - 25 Mar 2005 19:35 GMT
Sue,
Appreciate your suggestion but I'm not clear about using the Item_Write
event handler or the Validation field. Tried using the formula you suggested,
[FieldName] <> "", in the Validation field but it didn't stop a user from
sending a form with empty required fields.

Or were you suggesting [FieldName] <> "" written into the code in the
Item_Write event handler? If so, for a form with 9 lines/8 fields per line
what are the conventions in writing a code string as far as parenthesis,
brackets, commas etc. to enable 4 fields (all text) on each line to be
required, if and only if, one field on a line has an entry.

> You have to use either a formula or code in the Item_Write event handler.
> Think about what you'll accept as "good" data and what other constraints
[quoted text clipped - 17 lines]
> > is quite extensive and can't be used in an expression such as IIf( expr ,
> > truepart , falsepart ). So how do I make fields required?
Sue Mosher [MVP-Outlook] - 25 Mar 2005 20:10 GMT
No, I was suggesting that if you put [FieldName] <> "" as the validation
formula for a text field named FieldName, the user will be forced to fill in
that field. Of course, if the actual field name and the name of the field in
the validation formula don't match, the formula won't work.

I don't know what you mean by "9 lines/8 fields per line".

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Sue,
> Appreciate your suggestion but I'm not clear about using the Item_Write
[quoted text clipped - 21 lines]
>>
>>     [FieldName] <> ""

>> > In a form to request that a distribution center not pick a
>> > product/products,
[quoted text clipped - 10 lines]
>> > ,
>> > truepart , falsepart ). So how do I make fields required?
RF Office user - 29 Mar 2005 19:13 GMT
OK the formula worked when I used it in the Validation field. Thanks!

However, what I really need is a way to make a field conditionally required.
For example, on the first box of each of the nine lines of this form I have a
drop down box for a distribution center and each of those boxes has a unique
field name. Oftentimes it will not be necessary to complete all nine lines.
So what I need is, if the distribution center box is completed, then three
fields on that line MUST be filled in, such as Model Type, Reason etc.

> No, I was suggesting that if you put [FieldName] <> "" as the validation
> formula for a text field named FieldName, the user will be forced to fill in
[quoted text clipped - 43 lines]
> >> > ,
> >> > truepart , falsepart ). So how do I make fields required?
Sue Mosher [MVP-Outlook] - 29 Mar 2005 19:20 GMT
I'm having a difficult time following your description, because Outlook forms don't have any concept of "lines." But let's try anyway: If the text Distribution Center text box has data in it, then the Model Type box also needs data in it. Is that correct? If so, try applying the logic we've already discussed to create a validation formula for the Model Type box.

What are scenarios when Model Type has "good data"? One is when the Distribution Center text box is blank. Another is when the Distribution Center text box is not blank and the Model Type box is not blank. Expressed as two True/False expressions in a validation formula, this would look like:

   ([Distribution Center] = "") OR ([Model Type] <> "")
Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> OK the formula worked when I used it in the Validation field. Thanks!
>
[quoted text clipped - 52 lines]
>> >> > ,
>> >> > truepart , falsepart ). So how do I make fields required?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.