0

我正在尝试从表中提取电子邮件地址并将它们格式化为可在 Outlook 消息的“TO:”字段中使用的字符串。出于某种原因,我编写的循环正在冻结程序。谁能发现我做错了什么或提供更好的方法来做到这一点?这是我目前拥有的代码:

Private Function GetMailingList() As String

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim results As String

    results = ""
    Set db = CurrentDb
    Set rs = db.OpenRecordset("lut_holdEmailList")

        Do Until rs.EOF
            results = results & rs.Fields("emailAddress") & ", "

        Loop

    GetMailingList = results

End Function
4

1 回答 1

0

你错过了MoveNext电话:

将此行添加到执行直到循环

rs.MoveNext()
于 2011-09-05T23:27:58.557 回答