I can't work out why I'm getting that error for this code
the object oAEmails is as follows...
I get one record / email address as expected, I then seem unable to access it?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
Code:
Dim vEmail As Variant
For Each vEmail In oAEmails.Accounts(oContact.ARNo)
Debug.Print vEmail [b]<--- erroring here[/b]
Next
the object oAEmails is as follows...
Code:
Option Compare Database
Option Explicit
Private rs As DAO.Recordset
public Property Get Accounts(ByVal sARNO As String) As Collection
' additional accounts emails
Set Accounts = New Collection
Set rs = CurrentDb.OpenRecordset("SELECT Email FROM Accounts_Emails WHERE AR_No = '" & sARNO & "'")
Do While Not rs.EOF
Accounts.Add rs.Fields("Email")
rs.MoveNext
Loop
Set rs = Nothing
End Property
I get one record / email address as expected, I then seem unable to access it?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music