Multi-selection list box - InfoPath Dev
in

InfoPath Dev

Multi-selection list box

Last post 04-20-2011 07:34 AM by steveyb. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 04-18-2011 07:54 AM

    Multi-selection list box

    Hello

    I can't get a simple MSLB or checkbox list control working in InfoPath 2010 Advanced Database template connected to an Access db in accdb format.

    The error I get is "A multiple-selection list box control must be bound to a repeating field with a text data type".  I tried using Choice groups, Repeating sections, tables etc to no avail.

    I just want a control that allows a user to select more than one value.  Once submitted I hope the Access database will insert each value into the same field in the table.  For example, if the values in the multi-selection list box are "Red", "Green" and "Blue" and the user selects all three values in the control, for the values in the table's field to display as "Red, Green, Blue" or "Red; Green; Blue"

    Can someone help me please?

  • 04-19-2011 03:17 AM In reply to

    Re: Multi-selection list box

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-19-2011 05:29 AM In reply to

    Re: Multi-selection list box

    Hi Jimmy

    Thanks for your reply.  I can look at that thread and the formula in the attached files after I've got the control to work.

    Currently, each time I click to use a multi-selection list box and bind it to the text field in the .ACCDB database, I get the error, "A multiple-selection list box control must be bound to a repeating field with a text data type".  I don't quite know what a repeating field is.  Do I have to make a change in the Access database?

    Thanks

  • 04-19-2011 05:56 AM In reply to

    Typically the thing to do with a multi-select box is to bind it to a field in the main data source, and populate its choices from the secondary data source (your access database).  Consult the control's Properties dialog to set where you want the available values to come from.   As the error says, the place where you actually bind the control needs to be a repeating field, like shown in the attached image.  Access a field's property dialog to set it as repeating.


    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-19-2011 07:17 AM In reply to

    Re: Multi-selection list box

    That's what I'm trying to do; bind the control to the field in the main data source.  But I get the error attached in the JPEG.  The other attached JPEG shows the 'Repeating' setting property in the field's properties greyed out.  Once the control is embedded onto the canvas I can look at receiving data from a secondary data connection [or manually key in the values] and maybe look at that other post you initially linked me to for concatenating the values separated with semi-colons.

    Ooops, forgot to attached the images.  Please wait while I get them uploaded somewhere.

    Also, I notice that the icon of your field, "color" has a sort of drop down arrow whereas mine seem to have a padlock in the top right corner.

    Field Properties

    Error after trying to bind

  • 04-19-2011 08:45 AM In reply to

    Re: Multi-selection list box

    Hello,

    Having a "locked" main data source is the main downside of using a form based off a DB connection or Web Service connection.  If possible, I would urge you to design your own main data source as that allows for a lot more freedom when designing your form.  I think that's the only way that you're going to be able to use a multi-select box.  As my screenshot shows, the bound field itself has to be repeating, whereas your fields are members of a repeating group (you can see that d:Table1 has the same blue down-arrow as my color field).

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-19-2011 10:32 AM In reply to

    Re: Multi-selection list box

    I'm very new to InfoPath.

    Can the main data source be "unlocked"?

    The person I'm designing the form/database for will be running queries and producing reports for a dissitation.  After some efforts with InfoPath, I tried simply designing a form in Access but had issues so reverted back to InfoPath.  I also looked at using Classic ASP in a web based environment but I can't go installing IIS on her PC etc.  The InfoPath database method has to work.

    Do you have any suggestions please?

    Thanks for all your help so far.

  • 04-20-2011 06:34 AM In reply to

    Re: Multi-selection list box

    Jimmy, please excuse my ignorance.  I'm an InfoPath newbie.

    How can a data source be designed from scratch?  Would it involve the use of an XML Schema?

    I'm really surprised and dismayed if InfoPath cannot be used with Access in its current state to simply allow a user to select say 3 checkboxes from a group of 5 checkboxes and then have that data submitted into the db as "option1"; "option2"; "option3".  What I'm wanting to do seems so straightforward and I'd have thought that it'd be possible.

    Thanks for the patience.

  • 04-20-2011 07:04 AM In reply to

    Re: Multi-selection list box

    I made a mis-statement in my previous post.  It is possible to modify your data source, by adding new nodes underneath the root myFields node.  If you do this, you can set up the correct field structure, and then copy the concatenated value to one of the query fields.

     To design a data source from scratch, you can select Blank Form when creating a new template, and then create fields using the Data Source taskpane.  No need to manually type out an XML schema.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-20-2011 07:34 AM In reply to

    Re: Multi-selection list box

    Thanks for that, Jimmy.  How can I now connect to an Access database?  Is it possible from a blank template?

    I've now got a blank canvas template and added a field in the Data Source task pane leaving the "Type" drop down as "Field (element)" calling it "colour" as a test.  I quickly added the values manually (Red, Green, Blue).  I selected the "Repeating" checkbox option too.

    Thanks.

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