.AbsolutePosition属性有什么好处? [英] What are the benefits of .AbsolutePosition property?

查看:105
本文介绍了.AbsolutePosition属性有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MS Office开发人员中心网站上看到了.AbsolutePosition属性,并对其重要性感到好奇。


我主要关注字节,主要是关于VBA / Access论坛,我经常看到人们发布 Do While 循环,但他们不知道不包含.AbsolutePosition。始终存在相同的起点

展开 | 选择 | Wrap | 行号

解决方案

我主要用它来跟踪循环的进度占处理记录的百分比,如:

展开 | 选择 | Wrap | 行号


它可以为您提供记录集中当前记录的位置。


NB。这不是表中记录的相对位置,因为这是没有意义的。它也不是100%可靠,正如其他成员所注意到的那样。正如ADezii所说,它可以用于通过记录集确定进度。


@mcupito:

这是另一个上下文哪个.AbsolutePosition可以使用。我忘了提到我也用它来从Recordset中取一个随机记录,即在1和.RecordCount之间生成一个随机数,然后将.AbsolutePosition设置为它。

展开 | 选择 | Wrap | 行号

I came across the .AbsolutePosition property on MS Office Dev Center website and was curious as to its'' importance.

I''ve been active on Bytes primarily as far as VBA/Access forums are concerned and often I see people post Do While loops, yet they don''t contain .AbsolutePosition. There is always the same starting point

Expand|Select|Wrap|Line Numbers

解决方案

I use it primarily to track the progress of a Loop as a percentage of Records processed, as in:

Expand|Select|Wrap|Line Numbers


It''s something that gives you the position of the current record within the recordset.

NB. This is not the relative position of the record in the table, as that is meaningless. It is also not 100% reliable, as other members have noticed. As ADezii has said, it can be useful for determining progress through a recordset.


@mcupito:
Here is another context for which .AbsolutePosition can be used. I forgot to mention that I also use it to pluck a Random Record from a Recordset, namely generating a Random Number between 1 and .RecordCount then setting .AbsolutePosition to it.

Expand|Select|Wrap|Line Numbers


这篇关于.AbsolutePosition属性有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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