Hi,
I have two tables;
tblContacts
UNIQUE_ID can have multiple records in tblData, but only 1 record in tblContacts
I am trying to write some vba to;
Where tblContacts.Send_Email = Yes,
Filter tblData to records containing the UNIQUE_ID from tblContacts
Email that data as an xlsx format to the tblContacts.Email_Address
Loop for the 300 records in tblContacts
I've come up with some VBA to send the whole table to myself which works, but I can't work out how to do the filtering bit;
Sub testemail()
DoCmd.SendObject acSendTable, "tblFINAL_DATA_TO_SEND", acFormatXLSX, _
"dbn00bz@dbn00bz.com", , , _
"Test Email Data", , False
End Sub
Any help or advice, greatly recieved.
Thanks,
DbN00bz
I have two tables;
tblContacts
300 rows,
4 columns; Name, UNIQUE_ID, Email_Address, Send_email
tblData4 columns; Name, UNIQUE_ID, Email_Address, Send_email
18000 rows,
Various columns of data including UNIQUE_ID
Note: Various columns of data including UNIQUE_ID
UNIQUE_ID can have multiple records in tblData, but only 1 record in tblContacts
I am trying to write some vba to;
Where tblContacts.Send_Email = Yes,
Filter tblData to records containing the UNIQUE_ID from tblContacts
Email that data as an xlsx format to the tblContacts.Email_Address
Loop for the 300 records in tblContacts
I've come up with some VBA to send the whole table to myself which works, but I can't work out how to do the filtering bit;
Sub testemail()
DoCmd.SendObject acSendTable, "tblFINAL_DATA_TO_SEND", acFormatXLSX, _
"dbn00bz@dbn00bz.com", , , _
"Test Email Data", , False
End Sub
Any help or advice, greatly recieved.
Thanks,
DbN00bz