What is wrong with this code?

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I am using this code that was posted in the forum by Phill a while back and I
am getting an error message:

Dim rs As DAO.Recordset
Dim sAddress As String, sql As String
sql = "SELECT email FROM emailReports"
Set rs = CurrentDb.OpenRecordset(sql)
Debug.Print sql
rs.MoveLast
sAddress = Join(rs.GetRows(rs.RecordCount), ";")
MsgBox sAddress
********************************
The Error message breaks on "sAddress=Join(rs.GetRows(rs.RecordCount),";")
Message:"Invalid procedure call or argument"
any idea what is wrong?
thanks
 
Thank you very much Chris. Is there a substitute for Join that would
accomplish the same thing?
 
Thanks, I will

Chris O'C via AccessMonster.com said:
No. You'll have to write a function that iterates through the recordset and
appends the value in the field to a string variable, followed by a semicolon.

Chris
Microsoft MVP

Thank you very much Chris. Is there a substitute for Join that would
accomplish the same thing?
Phill's code doesn't work because Join requires a one-dimensional array, but
GetRows returns a two-dimensional array.
[quoted text clipped - 6 lines]
any idea what is wrong?
thanks
 
Back
Top