Count droplist boxes on a form - InfoPath Dev
in

InfoPath Dev

Count droplist boxes on a form

Last post 09-27-2016 09:57 PM by Elias. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-26-2016 11:04 AM

    • Elias
    • Not Ranked
    • Joined on 09-25-2016
    • Posts 3

    Count droplist boxes on a form

    I have a form on infopath project.I have fields (droplist boxes) on which I insert names(string value) connected with an access database table.I have another field(textbox) in the form, in which I would like to be displayed automatically,(using a button event handler for example) an intenger that comes from total number of my fields(droplist boxes) in case they are not blank.A simple examble so that I become more specific: A form with three fields: field1 filed2 filed3 If field1 has the valued "Maria",or whatever string value, and field2 has the value "Nikos",or whatever string value, I want the filed3 value to be ,in this case, "2" which are the number of string valued fields. Is that possible to become programmatically using vba code? Thank you in advance.
  • 09-27-2016 02:36 PM In reply to

    Re: Count droplist boxes on a form

    Sure, all things are possible with code. You'd just need to determine which nodes you care about, and count if they are blank or not - but you wouldn't have to use code for this. See the attached sample for another approach. Save the file locally, right click and select design to open in design mode and then you can preview.
    Hilary Stoupa

  • 09-27-2016 09:39 PM In reply to

    • Elias
    • Not Ranked
    • Joined on 09-25-2016
    • Posts 3

    Re: Count droplist boxes on a form

    Thank you very much ,dear for your answer.Have a nice day.In this attached file I saw that the fields that are counted ,are the blank ones.I want the fields that are NOT blank to be counted.I noticed that on the last field that displays the number of blank filelds, there is a default value "count(*[. = ""])".Can you please tell me the "count" expression that displays the number of NOT BLANK fields?Thank you very much.
  • 09-27-2016 09:57 PM In reply to

    • Elias
    • Not Ranked
    • Joined on 09-25-2016
    • Posts 3

    Re: Count droplist boxes on a form

    O.K. I found out the count expression.It is the count(*[. != ""]) - 1 In this way on the last field is displayed the number of the previous fields that are not blank! Thank you very much for your help.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.