How to count the number of checkboxes selected in Infopath? - sharepoint-2010

I have a column in a SharePoint List of type "Choice" - it's a collection of Checkboxes. I need to add an action in Infopath where the number of Checkboxes that are selected is assigned to another variable. How can I get the number of checkboxes that are selected?
thanks

have you tried creating a field in your infopath form that is set on open to be the sum of whatever your checkbox value conditions are? So for instance you would do several checks for values and where the condition is met increment your counter by 1 by using the set value for field action.

Related

Listbox in VBA apply selection on per row basis

In access 2010 I am trying to create a listbox in a form. Once I make a selection for a row in the form, the listbox automatically assigns those values to all the rows instead of on a per row basis.
Does anybody know how to change this option such that the listbox assigns the values per row?
I am doing this via the clickable solutions since I do not know any VBA code.
This happens when the listbox is unbound - then the value selected is common for all visible records.
So, create a field in the table used as source for the form. Then bind the listbox to this field.

Update table column line by line based on yes/no values from combo box

I am very new to Access and VBA but what i'm trying to do is simple:
I have a table which i want to show in a form, i have put said table in a subform box.
I want to have a column in which i want to update the status based on options from the combo box (yes/ no/ maybe).
So as shown in the picture: i want to select a line in the subform and update the column status by selecting an option in the combo box.
You can modify the selected record in the subform in the AfterUpdate event of the combo box.
Private Sub cboStatus_AfterUpdate()
subForm1.Form!Status = cboStatus
End Sub
This assumes that your combo box control is named cboStatus, your subform is named subForm1, and the field you want to update is named Status. It also assumes you aren't using numerical ID's as foreign keys for your values.
You will only be able to update one row at a time.
Beyond the scope of your question....
There are numerous other ways to develop an interface to edit the row. One way is to modify the field Lookup properties in the table. You can change the Display Control to a Combo Box, set the Row Source type to Value List, and then set the Row Source to a list of possible values separated by semicolon.
Now whenever you open that table in a datasheet view (like the example on your subform) a dropdown will appear in that column. A user can edit directly in that view without requiring a separate combo box control.

Query For Dynamic Reports

I have a requirement for the following logic to be implemented. lets Assume there is a property listbox where user gives the input.
When the field left blank. It should show message "All properties Selected" in d report
If the user selects or gives multiple properties.It should display the properties selected like xxx,yyy,zzz selected
SO now if user selects all the properties manually from d drop down list,i wanna display All properties selected .
Implemented now for 1st two requirements. Can any1 give some idea regarding the 3rd Demand
If I understand your question correctly you could do the following:
Create a parameter.
Set the parameter to internal.
Make it a multi-select parameter.
Set the available values to a data set that returns the list of all possible fields.
Set the default value to the data set that returns the list of all possible fields. Basically, you are selecting all by default in the internal parameter.
In the data set that executes your report code, add code that compares the count of records from the internal parameter to the count of records from the parameter that users can see for selecting records. If the counts are equal, then the user has selected all possible properties.
If I misunderstood and you are trying to get the parameter box itself to vary it's output, then this won't help.
This expression will check the number of selected values against the number of available values and display "All properties selected" when all the properties are selected and will list the selected properties when only some of the values are selected:
=iif(Parameters!YourParameterName.Count=CountRows("YourParameterSelectDataset"),
"All properties selected",join(Parameters!YourParameterName.Value,","))

Adding the value of a combobox to a hidden column when a user enters a new record in Access 2003

I have a table with a 'category' column, a form which hides the category column, and a combobox to filter the category, let's say R, C, and F.
I want to have the value of the comobox applied to the hidden 'category' column when a user enters a new record into the form.
Is there I way I can get an instance to the record as it's being entered and modify the data using VB? Or would I have to write a sort of pop() function and have it run afterInsert and then modify it that way? Can I even alter the table using VB like this?
simplest answer is bind the category field to the combo box.
otherwise use the afterupdate event to do: me.category = combobox.value

Continuous form with dependent combo boxes

I have a continuous form that has a dependent combo box on it. I have the dependent working individually for each row/record BUT the dependent combo box is blank unless it has focus then it shows the saved data so what I did was placed a text box over the data portion of the combo box and set its control source to the same field as the dependent combo box and required and it worked great BUT unlike a combo box which would show the name it shows the saved data which is a ID number so I guess my question is how can I show the name and not the data?
Thanks!
You'll need to clarify, but if the combobox is bound to a field of the form, and its RowSource displays two columns - say an ID and Name - then giving the first column a width of 0 will persuade it to display the Name, rather than the ID.
You will also need the Column Count to be 2 (or more) and the Bound Column to be 1 (the ID). Then set the Column Widths to 0cm;2cm (add more values if more than 2 columns).
Added
Remove this criteria from your cobmobox's Row Source:
[Forms]![frm_DelayMachineOutputSubform]![cboCategory]
It is not needed. The ActivityID (and the CategoryID) are obtained for each row in the form.
Remove these lines from the Current event as well:
Me.cboActivity.Requery
Me.txtActivity.Requery
again, they are not needed (and cause the flicker). Better yet, just delete this event-code.