Validating Form testing 2 Conditions

Status
Not open for further replies.

Mel-4-short

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hello,
I am trying to test whether or not:
If the field "Invoice" (i have an option button bound to it) is empty AND the TO: field is not equal to an address, then display error. Here's the latest code I've tried:

IIf(([To]<>"mailaddress") AND ([invoice]<>"")) OR (([to]<>"mailaddress")AND([Invoice]<>"")))

I've tried numerous ways without parenthesis, etc., but no luck. Is this even possible?
Thanks so much!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Oh. It might be the double negative. If To does not = address1 OR it does not = address2, it's always going to pass, as one is always going to be true. (Plus, it might fail if there is more than one address in the to field. )

This seemed to work here (i didn't have an invoice field to check :)) but then I remembered the double negatives. I am getting messages marked true.
IIf(([To]="address1" Or [To]= "address2") And [Last Verb Exec Type]="102","True","False")

This also seems to work, but i don't have a good test set so i could be wrong on the address expression.
IIf(([To]="address1" Or "address2") And [Last Verb Exec Type]="102","True","False")

If you need to use <> , try using 3 iif's
IIf( invoice = "", IIf(if to <> address1, "is true", iif(to <> address2, "is true", "is false"))
 

Mel-4-short

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Thank you so much for the quick reply. I think I should have explained what I was doing better.
-I would like to have person 1, send an invoice approval form with an attachment to person 2. (Acctspay person)
-Person 2 approves (Click yes to pay & click yes to close PO).
-Person 2 forwards the form back to person 1 with their approvals (I need to validate and make sure 2 fields are not empty.)
-Person 1 forwards the form to person 3 with the approvals, the final resting place.

Issues I'm having:

I can use the easy validation method but when person 1 sends the form, it validates those fields and we don't want that quite yet. ONLY if the form is being sent to 1 of 2 addresses.

My workaround for that is I creating another form where the only change from a message form is that I called my Invoice Approval form on the forward action. The validation works beautifully, however, anything person 1 or 2 puts in the message field is not saved after forwarding (I'm assuming because it keeps calling a new Invoice Approval form).

My next thought is to go back to using 1 form, and trying to using a formula for my validation instead of just testing if it's empty.

So, I'd like to use the formua and 1 form. The formula I tried doesn't error but doesn't work either.

:) I so appreciate you and your help. Thank you!
-Mel
[DOUBLEPOST=1418135543][/DOUBLEPOST]IIf(([To]="mailaddress" Or "mailaddress") And [invoice]<>"")

The logic here seems correct, but doesn't seem to work...
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I think you'll need to use 1 form and a formula. Unless you also pull in the message body field when you create the invoice form.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
R Validating a group of Checkboxes Outlook VBA and Custom Forms 2
à Validating build of Exchange 2010 SP1 Exchange Server Administration 1
D Emailed form is blank Outlook VBA and Custom Forms 0
F Validation on custom task form after task acceptance Outlook VBA and Custom Forms 1
C Add Form to Appointments Received, Automatically Outlook VBA and Custom Forms 6
V Date and/or time error in Outlook Form Outlook VBA and Custom Forms 0
A Form Position with Dual Monitors Outlook VBA and Custom Forms 2
I Error saving screenshots in a custom form in outlook 2016, outlook 365 - ok in outlook 2013, outlook 2010 Outlook VBA and Custom Forms 5
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
G Other users can't see P.2 with custom fields in Form Outlook VBA and Custom Forms 0
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
L Custom Form Tutoral? Outlook VBA and Custom Forms 6
D Lost Access to Custom Form Outlook VBA and Custom Forms 4
A Form style totally changes Outlook VBA and Custom Forms 2
M vCard does not have user-defined fields from my custom contact form (365) Using Outlook 1
S Outlook Custom Form Scripting only working when clicking on "Run this form" Outlook VBA and Custom Forms 2
V Making a Date field mandatory in outlook form Outlook VBA and Custom Forms 2
R Add 'Company' to Select Names Form Using Outlook 1
Victor_50 Outlook 2013 Custom Contact Form starts with "E-mail 2" Outlook VBA and Custom Forms 2
C Custom Form (seperate layout pages and message reading pane) Outlook VBA and Custom Forms 0
C Reading Pane for Custom Form Outlook VBA and Custom Forms 2
N Custom Form Controls Not Visible To Recipient Outlook VBA and Custom Forms 3
BretAB Is it possible to add a lookup field to a Message form? Outlook VBA and Custom Forms 4
Randy Redekopp How To Merge Contact Info to Email Custom Form Template Using Outlook 2
D Problem with custom form including _DocSiteControl1 Outlook VBA and Custom Forms 0
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
J Program Checkbox that will activate a text box in a Outlook fallible form. Outlook VBA and Custom Forms 1
W Message class changes of a custom form changes to the default form Using Outlook 2
A Possible to hide ribbon with custom appointment form? Outlook VBA and Custom Forms 3
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12
Andrew Quirl Custom form to route requests based on input criteria Outlook VBA and Custom Forms 1
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
D Using a VBA Custom Form to Send Reoccurring Email Upon Task Completion Outlook VBA and Custom Forms 4
W Setting up a custom form Outlook VBA and Custom Forms 2
A Greyed out checkbox in custom form Outlook VBA and Custom Forms 4
Z Outlook Custom Form: Adding Dropdown(Project Code) at the end of subject Outlook VBA and Custom Forms 0
Z Adding dropdown list using custom form Outlook VBA and Custom Forms 7
J Approval Form Outlook VBA and Custom Forms 0
G Mass Updating Contact form used Outlook VBA and Custom Forms 8
N Creating a button or link to a form in the Organizational Forms Library Outlook VBA and Custom Forms 3
H VB script in outlook form doesn't work anymore Outlook VBA and Custom Forms 2
J autocomplete function in custom form Using Outlook 1
D Custom form with html hyperlink Outlook VBA and Custom Forms 7
D Add Tetxbox at form open Outlook VBA and Custom Forms 1
D populating listbox on custom form from Access Outlook VBA and Custom Forms 7
D Custom Form Accept and Reject Command buttons Outlook VBA and Custom Forms 2
D create an html table in outlook custom form 2010 using vba in MsAccess Outlook VBA and Custom Forms 7
Potty Ash MS Outlook 2010 custom form - validation or formula to request user to check a checkbox Outlook VBA and Custom Forms 16
D Customized Contact Form Losing UDFs. Outlook VBA and Custom Forms 12
J Custom form code doesn't run Outlook VBA and Custom Forms 2
Similar threads


















































Top