vba MS Access 2003 - 选项组框架:我可以添加属于框架的文本框而不是 rad 按钮选项吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2484416/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 11:26:42  来源:igfitidea点击:

MS Access 2003 - Option Group frame: can I add text boxes that are part of the frame instead of rad button options?

ms-accessvbacontrolsaccess-vbams-access-2003

提问by Justin

Ok so this maybe a simple/silly question but I don't know so here goes:

好吧,这可能是一个简单/愚蠢的问题,但我不知道,所以这里是:

In access let's say I want to have a frame control, so I click the option group button and add it to the desgin surface. However, I am not wanting to use this as a option group with radio button selection, instead I would like to add text boxes instead the frame, so that when I reference the frame, it references every control instead of it, hence the text boxes, cbo boxes, etc.....just as it would if they were radio option selections.

在访问中,假设我想要一个框架控件,因此我单击选项组按钮并将其添加到设计表面。但是,我不想将它用作带有单选按钮选择的选项组,而是我想添加文本框而不是框架,这样当我引用框架时,它会引用每个控件而不是它,因此文本框、cbo 框等......就像它们是单选选项一样。

So can you do this?

那么你能做到吗?

I want whatever controls I add inside the frame to be easily referenced (i.e. make all controls visible just by using frameExample.visible = true) so that I can build my own tab control groupings.....

我希望我在框架内添加的任何控件都可以轻松引用(即,只需使用 frameExample.visible = true 即可使所有控件可见),以便我可以构建自己的选项卡控件分组.....

can this be done?

可以这样做吗?

Thanks!

谢谢!

EDIT:

编辑:

What I am trying to accomplish is having a form that includes a collection of controls (input controls - cbo boxes, text boxes, etc), that serve as the Main record information. These are saved to a table via an INSERT statement on button_click because this form is unbound.

我想要完成的是拥有一个包含一组控件(输入控件 - cbo 框、文本框等)的表单,用作主记录信息。这些通过 button_click 上的 INSERT 语句保存到表中,因为此表单未绑定。

Next I have 8 categories that are relative per each main record (and data that goes along with it). Each of these categories could have a sub form area and a button click that bring it's relative form into the sub form area. These sub forms would be unbound as well as I would just save data via SQL statement. So i know I could accomplish this by running the insert statement from the parent form, on the main collection control's data that would create the KeyID number, then run a SQL statement that would turn around and load that KeyID number right back onto the page in a hidden text box.

接下来,我有 8 个类别,每个类别都是相对的(以及与之相关的数据)。这些类别中的每一个都可以有一个子表单区域和一个按钮单击,将其相对表单带入子表单区域。这些子表单将是未绑定的,因为我只会通过 SQL 语句保存数据。所以我知道我可以通过从父窗体运行插入语句来实现这一点,在主集合控件的数据上创建 KeyID 号,然后运行一个 SQL 语句,该语句将转身并将该 KeyID 号加载回页面一个隐藏的文本框。

Then when I click one of the sub forms and load its relative collection of controls, I could then save that data along with KeyID for each of these sub-forms/tables.

然后,当我单击其中一个子表单并加载其相关控件集合时,我可以将这些数据与每个这些子表单/表的 KeyID 一起保存。

SO......

所以......

I was wondering if instead you could define these controls as a collection so that you could hide and make visible all the ones you need on button clicks and avoid the need for additional forms (subs). I know that if a user enters data into a text box, and then somewhere along the way that box becomes hidden, the data still exists in it and still ends up in the SQL statement....

我想知道您是否可以将这些控件定义为一个集合,以便您可以隐藏和显示按钮单击所需的所有控件,并避免需要其他表单(子)。我知道,如果用户将数据输入到文本框中,然后在该框隐藏的过程中的某个地方,数据仍然存在于其中并最终出现在 SQL 语句中......

So I want all these controls to exist on the same form, but I thought what is I could encapsulate them into a frame like an option group, then I could call the frame and all the relative controls would be called up (made visible) as needed.

所以我希望所有这些控件都存在于同一个表单上,但我想我可以将它们封装到一个框架中,就像一个选项组,然后我可以调用该框架,并且所有相关控件都将被调用(使其可见)为需要。

Sorry for the long explanation but I thought it would help.

抱歉,解释太长了,但我认为这会有所帮助。

回答by Fionnuala

I do not think you can do it with an Option Group, but what you are describing is pretty much a subform, yesno?

我不认为您可以使用 Option Group 来做到这一点,但是您所描述的内容几乎是一个子表单,是吗?

回答by David-W-Fenton

Some examples of hiding the tab control from an app that went live in March 1998:

从 1998 年 3 月上线的应用程序中隐藏选项卡控件的一些示例:

Tab driven by transparent command buttons over labels styled to look like colored command buttons: alt text

标签由透明命令按钮驱动,标签样式看起来像彩色命令按钮: 替代文字

Same approach, more buttons: alt text

同样的方法,更多的按钮: 替代文字

In this case, fake colored command buttons don't drive the tab, but insted show/hide the tab and a subform. In this case, the tab is actually driven by the listbox: alt text

在这种情况下,假彩色命令按钮不会驱动选项卡,而是显示/隐藏选项卡和子表单。在这种情况下,选项卡实际上是由列表框驱动的: 替代文字

A view of when the tab is hidden and the subform revealed. The listbox drives navigation within the subform, which has a visible tab on it: alt text

隐藏选项卡和显示子表单时的视图。列表框驱动子表单内的导航,子表单上有一个可见的选项卡: 替代文字

So, there's a lot that can be done without showing the tab control.

因此,有很多事情可以在不显示选项卡控件的情况下完成。