Data Validation - Compare 2 fields - InfoPath Dev
in

InfoPath Dev

Data Validation - Compare 2 fields

Last post 04-27-2010 05:55 AM by mark_jam3s. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-20-2010 02:16 AM

    Data Validation - Compare 2 fields

     Hi,

     I'm trying to do some validation on a data entry field but can't seem to get it to work!

    I have a form which is connected to my main SQL data source. 
    Whithin this form is a Text field which is bound to a field called STCODE.  When the form is compleated the value in the STCODE field is submitted to the SQL database.

    I have also set up a second SQL data connection which is a list of around 30,000 valid STCODES. 
    The name of the secondary field is called CODE.  I only use this field for comparison, not entering data.

    What I would like to do is when a user types in an STCODE and moves to the next field, to check if what the user has entered in the STCODE field is already in the secondary data connection field of CODE.

    If the STCODE appears in CODE the code is valid and the user can carry on with the rest of the form. 
    If STCODE does not appreas in CODE show an error message. 

    The steps I have followed are:

    Clicked on STCODE text box properties.

    Clicked Rules and added the condition "STCODE is not equal to CODE" to select the CODE field I used the "select a field of group.." and navigated to the secondary data source.

    Added Action to show a dialog box with invalid code message.

    I've found this thread but I'm still having no joy :(

    http://www.infopathdev.com/forums/p/7968/29029.aspx#29029

    Have I actually got to enter formula in the condition?

    Not sure where I'm going wrong??!?

    Any help would be much appreciated.

  • 04-23-2010 10:07 AM In reply to

    • Selarim
    • Top 500 Contributor
      Male
    • Joined on 10-30-2009
    • Brazil
    • Posts 48

    Re: Data Validation - Compare 2 fields

     Mark, could you show the sceenshot (I'm not sure if I understood)?

     

    ; )

  • 04-27-2010 05:55 AM In reply to

    Re: Data Validation - Compare 2 fields

    Not sure if the screenshot will be of much help! :)

     Screenshot

    Whatever is entered into the 'SmearTakerCode' text box, I want to compare with my secondary data source field 'CODE'

    If 'SmearTakerCode' does NOT appear in 'CODE' for a message to display.

     Thanks for any help

     

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.