SendObject Loop不会循环遍历所有记录! [英] SendObject Loop does not loop through all records!!

查看:88
本文介绍了SendObject Loop不会循环遍历所有记录!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的循环代码出错了。代码非常有效。但是,它只循环3个记录,然后完成而没有错误。我将在下面发布代码。任何帮助都将非常感激。


我使用Windows 2000和Access 2000,通过Outlook 2000发送电子邮件。

I am having trouble with my loop code. The code works very well. However, it only loops through 3 records and then completes without errors. I will post code below. Any help with this would be greatly appreciated.

I am using Windows 2000 with Access 2000, sending email through Outlook 2000.

展开 | 选择 | Wrap | 行号

推荐答案

我还应说明此代码的目的是首先从表中选择供应商和供应商电子邮件(仅选择那些有电子邮件)。然后是向每个供应商发送一封电子邮件,其中包含自己的报告。


截至目前,它每次都能完美地记录前三个记录。它将该供应商的报告发送给正确的供应商电子邮件。


当我知道记录集中有7个recods时,我无法弄清楚为什么它会在三个记录之后结束(通过表单视图) )。


请帮我完成这个DB。我很接近完成这个。(最后一块在成品之前放在一起)


提前谢谢(再次)


Nick
I should also state that the purpose of this code is to first select the supplier and supplier email from a table (only selecting ones that have emails). Then it is to send an email to each supplier with its own report in it.

As of now it works perfectly for the first three records everytime. It sends the report for that supplier to the correct supplier email.

I just cannot figure out why it ends after three records when I know there are 7 recods in the recordset (via form view).

Please help me to finish this DB. I am so close to finishing this.(last piece to put together before it is a finished product)

Thank you in advance (Again)

Nick


嗨。乍一看,您的代码似乎没有错误。但是,在第11行,您通过引用表单的recordset属性来设置记录集对象;规范是使用 recordsetclone 方法。


尝试设置rst = Me.Recordsetclone 而告诉我们这是否能解决丢失的记录问题。


如果它不能解决丢失的记录,你必须通过设置断点并检查所有记录来检查循环中正在进行的处理正在处理(比如在循环中的各个字段上使用Debug.Print)。


-Stewart
Hi. At first glance there appear to be no errors in your code. However, at line 11 you are setting the recordset object rst by referring to the recordset property of the form; the norm is to use the recordsetclone method to do so.

Try set rst = Me.Recordsetclone instead and let us know whether this resolves the missing records issue.

If it does not resolve the missing records, you will have to check the processing going on within the loop by setting a breakpoint and checking that all records are being processed (using, say, Debug.Print on individual fields within the loop).

-Stewart



嗨。乍一看,您的代码似乎没有错误。但是,在第11行,您通过引用表单的recordset属性来设置记录集对象;规范是使用 recordsetclone 方法。


尝试设置rst = Me.Recordsetclone 而告诉我们这是否能解决丢失的记录问题。


如果它不能解决丢失的记录,你必须通过设置断点并检查所有记录来检查循环中正在进行的处理正在处理(例如,在循环中的各个字段上使用Debug.Print)。


-Stewart
Hi. At first glance there appear to be no errors in your code. However, at line 11 you are setting the recordset object rst by referring to the recordset property of the form; the norm is to use the recordsetclone method to do so.

Try set rst = Me.Recordsetclone instead and let us know whether this resolves the missing records issue.

If it does not resolve the missing records, you will have to check the processing going on within the loop by setting a breakpoint and checking that all records are being processed (using, say, Debug.Print on individual fields within the loop).

-Stewart



I尝试过RecordsetClone ......当我这样做时,它只在第一个Record上循环。


另外,我注意到,对于多个供应商,我有相同的联系方式。它似乎在连续两次重复相同的联系后停止......第三个文件。有什么帮助?

I did try RecordsetClone...When I do that it loops on the first Record only.

Also, something I noticed, for multiple suppliers I have the same contact. It seems to stop after repeating the same contact twice in a row...The third file. Any help?


这篇关于SendObject Loop不会循环遍历所有记录!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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