我需要在一个表单上使用多个选项组来使用文本填充相应的控件 [英] I need multiple option groups on one form to populate corresponding control with text

查看:54
本文介绍了我需要在一个表单上使用多个选项组来使用文本填充相应的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过大量的搜索,然后更多的尝试和错误,我在这篇文章中为ADezii提供了非常简单的指示。
http://bytes.com/topic/access/answer...oup-value-text

{非常感谢你ADezii。你帮了我很多次。}


但是,我想更进一步。


我有一个订单,人们可以订购6种不同尺寸的盘子。这6种尺寸是我的选择组。但是,许多客户订购了两种或三种不同的尺寸。所以我有字段Size1,Size2和Size3字段。有3个不同的选项组,但用户可以在所有三个框中选择的选项是相同的。我的意图是允许他们一次在一张表格上订购3件物品。所以我按照这里的说明进行操作,但是当我在OptionFrame2选项组中选择一个选项时,它只更新了Size1框。 (我理解为什么 - 因为它只是在After_Update上执行匹配而且OptionFrameX并没有真正链接到代码或属性中的SizeX。)


如果我'我没有意义,我希望FrameOption1填充Size1(带文本,不是整数值),FrameOption2填充Size2,FrameOption3填充Size3 -----但请记住,这三个选项中的六个选项相同框。


是否可以在这里扩展ADezii的原始思路以满足我更复杂的需求?或者我们需要采取新方法吗?我是一个非常基本的用户,所以最简单是最好的。 :-)


PS。如果您想知道为什么我会有一个选项组而不是复选框,那是因为每个尺寸的订单详细信息都不同。下拉也可以,但我认为选项组在我的应用程序中更清楚。


提前谢谢!!!

After a lot of searching and then even more trial and error, I made ADezii''s very straightforward instructions in this post work for me.
http://bytes.com/topic/access/answer...oup-value-text
{Thank you so much ADezii. You have helped me so many times.}

However, I want to take this one step further.

I have an order form where people order plates in 6 different sizes. Those 6 sizes make my option group. However, many customers order two or three different sizes. So I have fields "Size1", "Size2", and "Size3" with 3 different options groups, but the options for the user to choose from on all three boxes are the same. My intent is to allow them to order 3 items on one form all at once. So I followed the directions here, but when I picked an option in OptionFrame2 Option Group, it only updated the Size1 box. (I understand why--because it''s simply performing a match on the After_Update and the OptionFrameX is not really linked to SizeX in the code or properties.)

In case I''m not making sense, I want FrameOption1 to populate Size1 (with text, not a integer value), FrameOption2 to populate Size2, and FrameOption3 to populate Size3-----but remember, the six options are the same in all three option boxes.

Is it possible to extend ADezii''s original train of thought here to fit my more complex needs? Or would we need to take a new approach? I''m a very basic user so simple is best. :-)

PS. If you are wondering why I would have an option group instead of a check box, it''s because the order details for each size is different. A drop down would work as well but I think the option group is clearer for the user in my application.

Thanks in advance!!!

推荐答案

每个框架都有自己的一组事件,因此在FrameOption1的AfterUpdate事件中,您将在每个Case语句中引用Size1字段。 FrameOption2将引用每个Case语句中的Size2字段,而Size3则相同。
Each frame has its own set of events, so in the AfterUpdate event of FrameOption1, you would reference your Size1 field in each Case statement. FrameOption2 would reference your Size2 field in each Case statement and the same for Size3.


Hi Danica。好久不见!


我建议你做的是创建一个功能程序,为你完成工作,并为选项组传递一个参数价值。然后可以将返回值存储在您想要的任何字符串变量中。


这里有一些示例代码,用于说明我正在解释的内容(为此我'已经用选择()更简单地替换了 Select Case 代码,这完全足以满足此要求。):
Hi Danica. Long time no see!

What I suggest you do for this is to create a function procedure that does the work for you and pass it a parameter for the Option Group value. The return value can then be stored in any of the string variables that you want.

Here is some example code to play with that illustrates what I''m explaining (For this I''ve replaced the Select Case code with a simpler call to Choose(), which is perfectly adequate for this requirement.) :
展开 | 选择 | Wrap | 行号


您能告诉我在代码中输入的确切内容吗?

以下是我的内容:
Would you be able to tell me exactly what to type in my code?
Here is what I have:
展开 | 选择 | 换行 | 行号


这篇关于我需要在一个表单上使用多个选项组来使用文本填充相应的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆