PC Review


Reply
Thread Tools Rate Thread

Create a Validation Formulas

 
 
David Lao
Guest
Posts: n/a
 
      16th Jan 2005
Hi,

I tried to create a validation formulas for an input field without a
success. Here is the input in the field should contain "BUGM-" follow
with 8 digits number. Example, the valid value is BUGM-00001234 or
BUGM-12345678.

How can I create a formulas to valid this field ?


David


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      16th Jan 2005
A validation formula must evaluate to True if the data is "good" and False
if the data is not. In your scenario, several conditions must be met:

1) The total length must be 13.
2) The first five characters must be "BUGM-"
3) The right-most eight characters must be numeric.

For #1, use the Len() function.
For #2, use Left().
#3 is the tricky one since Outlook forms don't support IsNumeric() for
validation formulas. Instead you can use Val():

(Len([MyField]) = 13) AND (Left([MyField], 5) = "BUGM-")
AND (Val([Right(MyField, 8)]) > 0)

This assumes that BUGM-00000000 is not a valid value. If so, then you'll
have to add a term to allow for that, since Val() will give you a value of 0
in that case.

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


"David Lao" <(E-Mail Removed)> wrote in message
news:%23$QBX1B$(E-Mail Removed)...
> Hi,
>
> I tried to create a validation formulas for an input field without a
> success. Here is the input in the field should contain "BUGM-" follow
> with 8 digits number. Example, the valid value is BUGM-00001234 or
> BUGM-12345678.
>
> How can I create a formulas to valid this field ?



 
Reply With Quote
 
David Lao
Guest
Posts: n/a
 
      17th Jan 2005
Hi Sue,

It is very new to me to program in VBScript with Outlook. Thank you very
much for your helps.

David




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
RE: Validation with formulas Sheeloo Microsoft Excel Misc 0 27th Apr 2009 09:16 PM
Validation with formulas MarsBars Microsoft Excel Misc 0 27th Apr 2009 09:02 PM
Data Validation Formulas leimst Microsoft Excel Worksheet Functions 3 30th Jun 2008 03:15 AM
How to use validation formulas in Combobox =?Utf-8?B?R2xlbkM=?= Microsoft Excel Misc 1 21st Sep 2006 10:19 PM
validation formulas =?Utf-8?B?TGFycnk=?= Microsoft Excel Worksheet Functions 4 15th Apr 2005 03:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 AM.