views:

1070

answers:

2

I'm making an InfoPath form which is tied to an Access database. I have a set of radio buttons where the user selects the software name corresponding to the form, but I store this in my database as a number (1, 2, or 3). In another view, I want them to be able to see the previously entered software name, but not be able to change this. Here are the two options I've thought of:

  1. Create some rule that does prevents the user from changing this data

    This seems like the natural approach for what I want to do.

  2. Add a text field with a function mapping each number to the corresponding software

    As the form is tied to the database, InfoPath wants all fields to be tied to a database value, which would require creating another database entry. I'm also having trouble finding an InfoPath function I can use to handle this mapping.

  3. Change the radio box's variable to text values and make a text box in the new view, which can be made read-only.

    I'd really prefer not to do this, as it will make things messier for other programs using this database value and seems wasteful, but if nothing else works, this seems do-able.

Is there some sort of rule/method I could use to make this radio button control read-only?

+1  A: 

You can use conditional formatting to disable any control (including radio buttons). To set your control to always be disabled do the following:

  1. Right click on your control and select Conditional Formatting...
  2. Click Add...
  3. In the leftmost dropdown select The expression
  4. type true() in the text field (this tells InfoPath to always apply this formatting)
  5. Check the Disable this control checkbox.
  6. Click OK and OK.

Note: You will need to do this for each of your radio buttons.

Also, for future reference: If you simply want to display the result of a function (such as in your second solution) you don't need to use a text box. You can use an expression box. An expression box is not necessarily linked to a field in the datasorce, so you won't need an additional column in your database for it.

oillio
Reading this very late, but why would you need to do this on each radio button, and not to the option group of which they are child controls? If the parent option group is disenabled, all of its child controls are also disabled.
David-W-Fenton
A: 

Thanks a lot oillio for your answer, even if i am not the initiator of this thread, this answer helped me a lot :)

Paul J.