PC Review


Reply
Thread Tools Rate Thread

How to add required fields to an Outlook form

 
 
=?Utf-8?B?UkYgT2ZmaWNlIHVzZXI=?=
Guest
Posts: n/a
 
      24th Mar 2005
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?
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      24th Mar 2005
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] <> ""

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


"RF Office user" <(E-Mail Removed)> wrote in message
newsA193CD0-FD40-4311-9CE2-(E-Mail Removed)...
> 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?



 
Reply With Quote
 
=?Utf-8?B?UkYgT2ZmaWNlIHVzZXI=?=
Guest
Posts: n/a
 
      25th Mar 2005
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.

"Sue Mosher [MVP-Outlook]" wrote:

> 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] <> ""
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "RF Office user" <(E-Mail Removed)> wrote in message
> newsA193CD0-FD40-4311-9CE2-(E-Mail Removed)...
> > 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?

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      25th Mar 2005
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".

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


"RF Office user" <(E-Mail Removed)> wrote in message
news:B2D23CAC-EB53-40DE-8CEC-(E-Mail Removed)...
> 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.
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> 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] <> ""


>>
>> "RF Office user" <(E-Mail Removed)> wrote in
>> message
>> newsA193CD0-FD40-4311-9CE2-(E-Mail Removed)...
>> > 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?

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?UkYgT2ZmaWNlIHVzZXI=?=
Guest
Posts: n/a
 
      29th Mar 2005
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.

"Sue Mosher [MVP-Outlook]" wrote:

> 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".
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "RF Office user" <(E-Mail Removed)> wrote in message
> news:B2D23CAC-EB53-40DE-8CEC-(E-Mail Removed)...
> > 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.
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> 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] <> ""

>
> >>
> >> "RF Office user" <(E-Mail Removed)> wrote in
> >> message
> >> newsA193CD0-FD40-4311-9CE2-(E-Mail Removed)...
> >> > 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?
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      29th Mar 2005
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] <> "")
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"RF Office user" <(E-Mail Removed)> wrote in message news:6254F681-3221-4147-A120-(E-Mail Removed)...
> 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.
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> 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".
>>
>> --
>> Sue Mosher, Outlook MVP
>> Author of
>> Microsoft Outlook Programming - Jumpstart for
>> Administrators, Power Users, and Developers
>> http://www.outlookcode.com/jumpstart.aspx
>>
>>
>> "RF Office user" <(E-Mail Removed)> wrote in message
>> news:B2D23CAC-EB53-40DE-8CEC-(E-Mail Removed)...
>> > 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.
>> >
>> > "Sue Mosher [MVP-Outlook]" wrote:
>> >
>> >> 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] <> ""

>>
>> >>
>> >> "RF Office user" <(E-Mail Removed)> wrote in
>> >> message
>> >> newsA193CD0-FD40-4311-9CE2-(E-Mail Removed)...
>> >> > 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?
>> >>
>> >>
>> >>

>>
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Required form fields =?Utf-8?B?SEVsbGlzb24=?= Microsoft Word Document Management 1 13th Jun 2006 07:49 PM
Required Fields in a form tahuero Microsoft Access Forms 3 21st Mar 2006 01:46 AM
RE: Required Fields on Form =?Utf-8?B?UmFq?= Microsoft Access Forms 0 19th Nov 2004 12:11 AM
Required Fields on a Form =?Utf-8?B?SmVmZmluZXIxMQ==?= Microsoft Access Forms 1 28th Oct 2004 11:59 PM
Required form fields Sonars_UK Microsoft Frontpage 2 14th Oct 2004 12:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 AM.