在信息路径表单中制作一个单选按钮“只读”?
我正在制作一个与 Access 数据库绑定的 InfoPath 表单。 我有一组单选按钮,用户可以在其中选择与表单相对应的软件名称,但我将其作为数字(1、2 或 3)存储在数据库中。 从另一个角度来看,我希望他们能够看到之前输入的软件名称,但无法更改它。 以下是我想到的两个选项:
创建一些规则来阻止用户更改此数据
这似乎是我想做的事情的自然方法。
添加一个文本字段,其中包含将每个数字映射到相应软件的功能
由于表单与数据库绑定,InfoPath 希望所有字段都与数据库值绑定,这需要创建另一个数据库条目。 我也无法找到可用于处理此映射的 InfoPath 函数。
将单选框的变量更改为文本值,并在新视图中创建一个文本框,该文本框可以设为只读。
我真的不想这样做,因为它会让使用此数据库值的其他程序变得更加混乱,并且看起来很浪费,但如果没有其他办法,这似乎是可行的。
我可以使用某种规则/方法使该单选按钮控件变为只读吗?
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:
Create some rule that does prevents the user from changing this data
This seems like the natural approach for what I want to do.
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用条件格式来禁用任何控件(包括单选按钮)。
要将控件设置为始终禁用,请执行以下操作:
注意:您需要对每个单选按钮执行此操作。
另外,供将来参考:如果您只想显示函数的结果(例如在第二个解决方案中),则不需要使用文本框。 您可以使用表达式框。 表达式框不一定链接到数据源中的字段,因此您不需要在数据库中为其添加额外的列。
You can use conditional formatting to disable any control (including radio buttons).
To set your control to always be disabled do the following:
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.