with out seeing the query statement I would say that you need the loop statement in there like...
do until rs.EOF
' put in the code to send the email to your user or reference the page with the code
rs.MoveNext
Loop
as far as the query statement goes, as I understand your problem you need to join the two table. (I work in Sql so not sure how this should look in access) but we do it with a where statement in there so yours would look something like this, someone can maybe help convert it to access.
sql = (" select * from y, x where x.xid = y.xid2 ")
actually since the fields have different names you can leave off the x. and y.
you would then do the loop statement etc. before you close out the rs and db connection.
If the person you are emailing has more then one record you will need to throw in a loop statement inside the loop statement to return all of those records that belong to him.
I hope that helps.
Edited by wingking - 08 July 2005 at 5:15pm