Hiding item from summary when value is 0

B

bookstar

Hi there,

I'm a new user of InfoPath and am trying to build a simple order form
based on the purchase order sample template.

I have created a table with 3 columns: Item, Picture, Quantity

In the item column I have a text field with an item name in each row
(item1, item2, item3...) and the picture column contains a picture of
the each item. The quantity column shows a default value of 0 for each
item.

I want to create an order summary table that appears at the bottom of
the form. The summary should show the item name and quantity ordered,
but ONLY for items where quantity > 0. If the quantity of an item = 0,
I don't want that item to be listed in the summary table.

So far I have figured out how to make the list of item names and their
quantities appear in the summary table, and I can make the quantity
invisible on the summary table when = 0, but I don't know how to make
the item name invisible when its quantity = 0. Ideally this would not
create a blank row in the summary table (i.e. only items with
quantities > 0 should appear in the summary table).

Any assistance would be much appreciated. I can't seem to find the
right search terms to find an answer in the help files.
GP
 
B

Ben Walters

Hey GP,
Your best bet is to use the Filter Data option to show only the data you want.
If you open the properties for your summary repeating section and click on
the Display tab, you should see a "Filter Data" button.
Click on this button then Click "Add" in the resulting dialog box.
Select the quantity field from the first drop down,
Select Greater Than from the second drop down
and select "Enter Number...." in the third drop down and enter 0 then click
ok to save your changes
Click ok again to close the Filter Dialog and once more to close your
repeating table properties

This should do the trick for you

Let me know if it doesn't help

Cheers
Ben
 
B

bookstar

Hi Ben,

Thanks so much for your response. I can't seem to find a "Filter Data"
option. When I go to the section properties for my summary table and
click on the Display tab, my only option is "Conditional Formatting",
and the only condition it seems to allow is "Hide this control".

Having just started playing with InfoPath this week, I have probably
not set up the summary table properly. Likely, I haven't created the
original table properly either. To create my original order form, I
started with the Purchase Order sample and deleted the sections I
didn't need. I added a group called "Items" and in that group created
a field for each item (Item1, Item2...) and a field for each item
quantity (Quantity1, Quantity2...). I dragged the fields into the
appropriate table cells and added a column of images. The item
quantities display 0 as a default. The item names display the name of
each item as a default value, and are "read-only".

To create a summary table of items ordered, I created a new table and
copied in all the item name fields and quantity fields from the order
table. Then I tried to figure out how to hide both the name and the
quantity when quantity = 0. From your response I see the proper way
involves displaying item name and quantity when quantity does NOT = 0.

My goal is to create two tables and have the summary table generated
automatically from the order table, so that if Quantity2 = 0, this is
what displays:

Order Table
Item1 Picture1 Quantity1
Item2 Picture2 Quantity2
Item3 Picture3 Quantity3

Summary Table
Item1 Quantity1
Item3 Quantity3

My new questions are:
1. Is there a better way to create the original order table than
creating individual fields for each item and each item's quantity?
There will be 25 items in total but I'm guessing now that the proper
way to set this up involves creating 2 fields, not 50.

2. How do I link a quantity field to an item name field so that a data
filter can be used so that when quantity = 0 the item name and quantity
are not displayed in a second table?

Any advice to get me started in the right direction is much
appreciated!
GP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top