我正在尝试从表中提取电子邮件地址并将它们格式化为可在 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