I searched for an answer to this question, but I think I'm pretty unique in asking.
I need to send 5 emails to the users containing 10 records (based off the subform) for each user.
I can't figure out how to temporarily interrupt the htmlbody code in Access to allow me to go to the next record in the subform and then to go back to the htmlbody to create the next few lines of the email.
In essence, I want to do this:
.htmlbody="Results for February: " & [txtResults1]
'Stopping htmlbody to perform form commands
subfrmResults.SetFocus
docmd.GoToNextRecord , , acNext
me.SetFocus
'Restarting htmlbody
.htmlBody="<br><br>" &_
"Results For March: " & [txtResults1]
'Stopping htmlbody to perform form commands
subfrmResults.SetFocus
docmd.GoToNextRecord , , acNext
me.SetFocus
etc....
I have to use htmlbody because I'm creating memos for the users with html tables integrated into them.
My main question is:
Is there a way to be in the middle of creating an htmlbody, send out form commands, and then go back to the htmlbody to finish the email?
Secondary question:
I can do a workaround if needed and just use variants to temporarily store the data from each record and then create the email. How many variants will a procedure allow me to use though? I'm looking at about 80 to 100 with this process.
Oh...and I know I could just create a report to show all of this (and I have - I just can't email it with all the formatting). The recipients don't have snapshot viewer or Adobe Acrobat (and I'm not allowed to distribute either). They just have Outlook Web Access. RTF and HTML exports that are imbedded in the email's body won't work either since the rectangles in the Access report don't convert over.
So I'm stuck to either getting a miraculous solution to my main question or just using the workaround.
Thanks for any help you can offer.
I need to send 5 emails to the users containing 10 records (based off the subform) for each user.
I can't figure out how to temporarily interrupt the htmlbody code in Access to allow me to go to the next record in the subform and then to go back to the htmlbody to create the next few lines of the email.
In essence, I want to do this:
.htmlbody="Results for February: " & [txtResults1]
'Stopping htmlbody to perform form commands
subfrmResults.SetFocus
docmd.GoToNextRecord , , acNext
me.SetFocus
'Restarting htmlbody
.htmlBody="<br><br>" &_
"Results For March: " & [txtResults1]
'Stopping htmlbody to perform form commands
subfrmResults.SetFocus
docmd.GoToNextRecord , , acNext
me.SetFocus
etc....
I have to use htmlbody because I'm creating memos for the users with html tables integrated into them.
My main question is:
Is there a way to be in the middle of creating an htmlbody, send out form commands, and then go back to the htmlbody to finish the email?
Secondary question:
I can do a workaround if needed and just use variants to temporarily store the data from each record and then create the email. How many variants will a procedure allow me to use though? I'm looking at about 80 to 100 with this process.
Oh...and I know I could just create a report to show all of this (and I have - I just can't email it with all the formatting). The recipients don't have snapshot viewer or Adobe Acrobat (and I'm not allowed to distribute either). They just have Outlook Web Access. RTF and HTML exports that are imbedded in the email's body won't work either since the rectangles in the Access report don't convert over.
So I'm stuck to either getting a miraculous solution to my main question or just using the workaround.
Thanks for any help you can offer.