在Access 2010中的子窗体上创建行号 [英] Create row numbers on a subform in Access 2010

查看:319
本文介绍了在Access 2010中的子窗体上创建行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access DB,为了显示的目的,我正在尝试将未绑定的文本字段添加到包含每个记录的行号的连续子表单中。从一个非常古老的上一篇文章中我可以使它在我自己打开子表单时工作,但是当我打开连接子表单的主表单时它不起作用。


公共模块代码写成:

I have an Access DB that I''m attempting, for display purposes, to add an unbound text field to a continuous subform that contains a row number for each record. From a really old previous post I can make it work when I open the subform by itself, but it does not work when I open the main form with the subform attached.

The public module code is written:

展开 | 选择 | Wrap | 行号

推荐答案

您是否尝试在调用函数时将路径传递给子窗体?我不认为你需要.Form。在控制源或查询中。


= RowNum(Forms)![frmMainForm]![Child3])
Have you tried just passing the path to the subform when calling the function? I don''t think you need the ".Form" in control sources or queries.

=RowNum(Forms]![frmMainForm]![Child3])


引用子表单是一种真正的享受有时候。


通常这些错误都会发生在我身上,特别是在午夜,因为:

#Name =我找不到你所说的对象再说一遍,你确定你知道你在做什么 - 回去睡觉吧!

#Error =你在想什么......我无法理解你的想法,解决这个问题你小睡了之后。

#Type =真的,你没有认真地试图传递/返回错误的数据类型,去算一些羊,鸭,松鼠! br />

我有一个表单和子表单,我在其中使用IIF()和UDF来确定子表单是作为独立打开还是作为导航控件表单对象的一部分打开....是一种真正的享受,而不是。


无论如何,

= RowNum([Forms] [ParentFormName] [SubForm _container_Name] [表格])


说我有:

+父窗体名为[Form1]

+在[Form1]上,我的子窗体容器名为:

[frmQuery1_container]

+ that持有名为[frmQuery1]的子窗体

然后你的函数的引用将是:
= RowNum([Forms] [Form1] [frmQuery1_container] [表格])

>>>注意事项(!)和DOTS(。)PLACEMENT !!

通常,子表单容器以子表单命名。我重命名这些是因为这种命名造成的混淆是通过追加容器而形成的。到默认名称的末尾。
Referring to subforms is a real treat sometimes.

Often the errors come across to me, especially at midnight, as:
#Name = I can''t find the object you''re talking about, are you sure you know what you''re doing - go back to bed!
#Error = What are you thinking... I can''t read your mind, fix this after you''ve had a serious nap.
#Type = Really, you''re not seriously trying to pass/return the wrong data-type, go count some sheeps, ducks, squirrels!

I have a form and subform where in I use IIF() and UDF to determine if the subform is being opened as standalone or as part of a navigation control form object.... that was a real treat, not.

Anyway,

=RowNum([Forms]![ParentFormName]![SubForm_container_Name].[Form])

Say I had:
+ Parent form named [Form1]
+ On [Form1] that form I had the subform container named:
[frmQuery1_container]
+ that held the subform named [frmQuery1]

then the reference for your function would be:
=RowNum([Forms]![Form1]![frmQuery1_container].[Form])
>>> NOTE THE BANGS (!) and DOTS (.) PLACEMENT!!
Often the subform container is named after the subform. I rename these due to the confusion such naming creates by appending "container" to the end of the default name.


谢谢mbizup。它也没用。
Thank you mbizup. It didn''t work either.


这篇关于在Access 2010中的子窗体上创建行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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