English 中文(简体)
管理 如何从另一个次级产品中获得补贴的价值?
原标题:MS Access how can a subform get the value from another subform?

我的主要形式包括另外两个儿童分行。 当文箱对文后(A)进行价值改动时,我想确定文箱在文后(B)上的价值,等于文后(A)上改动的文本箱。

因此,我完全是新来接触我,我感到有些厌恶,它希望能与一些美国律师协会一道做到这一点。 因此,在更新活动之后,我增加了这一缩略语。

Private Sub ID_AfterUpdate()
    Me.Parent.Forms.formA.textboxDestination.Value = Me.textboxSource.Value
End Sub

I am doing this using the code builder. Then I save and run the form. Nothing happens. No errors.. nothing I am not even sure that piece of code is running. I m not even sure how one debugs VBA in Access. Can someone help me out?

感谢!

最佳回答

在用户改变其价值时更新控制火灾活动。 如果电离层的电离层是自动电离层的,那么当你增加新的记录时, d发动机将提供其价值。 然而,由于用户没有作出这一改动,更新后的活动没有火灾。

为了普遍脱胎的目的,你可以添加一条灯塔。 印刷或 Ms。

Debug.Print "my event fired"
MsgBox "my event fired"

参看Debug的产出。 印刷在VB编辑的网上窗口。 你可以从你的主要访问窗口到Ctrl+g键盘短片。

另一种做法是就你法典的一条线设定一个突破点。 右翼在代码线上,然后选择Toggle->Breakpoint from the context menu。 或者在左边点被点击,这样一只红色的狗似乎就标明了破碎点。 或者将F9的钥匙压在一边。 或选择Debug->Toggle Breakpoint from the VB Editor s main menu。

You can also type Stop on a line by itself to trigger break mode. However, you would need to remove it later. Those other breakpoints I mentioned are temporary and don t get saved in the code module.

然而,如果要打破模式,你就可以在F8钥匙的某个时候通过一条行程。 这将向你们表明执行哪条路线。 您还可以在任何时间通过打上问题标记,然后打上可变名称,然后在直线窗口中填入钥匙,检查变数的价值:

? MyVariable

• 探索VB编辑的主要菜单,以找到更多的脱胎选择。 例如,“观察窗口”将使你能够在你通过该守则时监测某些变量的数值。

问题回答

您不必具体说明母姓。

Me.Parent。 CONTROLNAME。 价值是一种工作法典。

关于

On the update property of the textbox you are changing, put the following:

[Forms]![frmContainingValueYouWantToChange]![txtTextboxYouWantToChange] = "newValueHere"

让我们知道你们是如何接手的?

我知道6年前,但我认为这里的错误是,你正在从<代码>formA向同一<代码>formA更新价值。

Me.Parent.Forms.formA actually igual to Me because you were calling :

更新活动之后的文箱

It should be formB and the word "Form" should be placed after (and the word "Value" isn t mandatory):

Private Sub textboxSource_AfterUpdate()
    Me.Parent.formB.Form.textboxDestination.Value = Me.textboxSource.Value
End Sub

http://access.mvps.org/access/forms/frm0031.htm 参照表格和代版特性及控制

Regards





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签