Conditional formatting doesn't apply following a query submission - InfoPath Dev
in

InfoPath Dev

Conditional formatting doesn't apply following a query submission

Last post 03-10-2010 09:05 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-10-2010 08:22 AM

    Conditional formatting doesn't apply following a query submission

    Hi, I'm really hoping someone out there can help me with this one, I can't find the solution anywhere!

    I've designed an InfoPath form, linked to an Access Database. The purpose of the form is to query a central database for a customer record, if it finds one it returns various field values. Additional fields in seperate sections are then populated by the person using the form and then the whole thing is re-submitted back to the same database. The fields that are updated are the customer's requirements for a specific public holiday.

    At the top of the form I have a series of check boxes, each with a unique date next to it. Checking one or more will display a specific linked section. Without any checks, no sections are displayed. This is to make sure that the 30 or so public holidays dont all display at once, keeping it nice and clean.

    I've done this with conditional formatting and it works fine for when I'm entering a new customer. However, when I run a query first which returns a customer record, all the other sections display, regardless of whether they have any values or not. I can then check and then uncheck the boxes and one by one they disappear , but this is far from ideal. It's almost like the conditional formatting isn't being applied when I'm running a query.

    Does anyone have any suggestions?

    Thanks guys n gals, Jon

     

     

     

  • 03-10-2010 08:38 AM In reply to

    Re: Conditional formatting doesn't apply following a query submission

     What exactly is the conditional formatting condition on each of the sections?  Is is just based on whether the checkbox fields' values are one value or another?  Are the checkboxes bound to fields that are returned by the query?

    One thing you can do is display the checkbox fields' values in an expression box to see if they are taking on an unexpected value.  Maybe they have the value 1 instead of true in which case the conditional formatting wouldn't apply, or something like that.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-10-2010 08:48 AM In reply to

    Re: Conditional formatting doesn't apply following a query submission

    Thanks for such a rapid response!

    All the boxes are set up as a "yes" / "no" for the true or false. The variable sections are then formatted to Hide if the value of the one it's paired with is "no". The fields of the actual checkboxes are bound to fields within the same DB table but this is only for convenience as I couldn't work out how to have them "stand alone". They're purely functional and have no meaning other than control within the form.

    I'll have a play about with them as per your suggestion and see if it throws anything up.

    Thanks for the help mate.

    Jon

     

  • 03-10-2010 09:05 AM In reply to

    Re: Conditional formatting doesn't apply following a query submission

     This is a perfect time for a secondary XML data source.  Just create a simple XML file in notepad like this (come up with better names for the elements):

    <SectionShowing>
         <Section1>no</Section1>
         <Section2>no</Section2>
         <Section3>no</Section3>
         <Section4>no</Section4>
    </SectionShowing>

    and add the XML file as a data source in your form.  Then bind the checkboxes to those fields.  This way you don't have to involve them in your Access query, and they won't be affected by your querying the database.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.