1

I have a form with a button that updates data in a table, form which works perfectly. However, when I add it as a subform on a tab paged form, it no longer does. Access prompts out asking for the [Forms]![MyForm]![textbox] variable, although it exists and is filled out. I'm guessing there's a different way to reference a subform.

4

2 回答 2

3

参考表单名称、子表单控件名称、表单属性和控件名称(参考MVPsMS)。你有 MS Access 2010,所以你可以使用查询设计窗口和智能感知来构建相关的字符串,它可以像这样工作:

 [forms]![Gestiune]![SubformControlNameHere].Form![idInchirieri]
于 2013-01-06T09:49:14.877 回答
0

该表达式[Forms]![MyForm]![textbox]可能出现在用作子窗体上 ComboBox 或 ListBox 的 RowSource 的查询中。Forms!MyForm这个子表单现在不再是

Forms!MainForm!MySubformControl.Form

我不知道正确的名称,请相应地调整它们。

将表达式更改为类似

Forms!MainForm!MySubformControl.Form!textbox
  • Forms是开放表格的集合。(不变)
  • MainForm是带有选项卡控件的窗体的名称。(适应)
  • MySubformControl是包含子窗体的控件的名称。(适应)
  • .Form指定子表单本身。(不变)
  • 最后textbox是你的文本框。(应该没问题,否则适应)
于 2013-01-06T01:05:22.063 回答