Re: email with criteria?
Hi forum,
I read many threads but didn't find what I was looking for...
This is my problem... there are 9 people entering info on a form. These people are called 'enrollers' and are in a table. These enrollers send the report to different people. For example:
Enroller Mary has to send report to John Doe
Enroller Ed has to send report to Michael J
Enroller Mark has to send report to Michael J and Christian P
etc, etc
I have the following code but it's only designed to send the report to a recipient. How do I change the code so when Mary, Ed or Mark sends the report it goes to the designated recipient???? Do I have to declare variables?? and then set cases?? Is this task even possible to accomplish???...
The form and the report have a field name called EnrollerName. I know there must be a way to set the criteria for the code above based on this field. But, I have no idea how to do it.
Thanks in advance.
- Larry -
VBA Amateur
Hi forum,
I read many threads but didn't find what I was looking for...
This is my problem... there are 9 people entering info on a form. These people are called 'enrollers' and are in a table. These enrollers send the report to different people. For example:
Enroller Mary has to send report to John Doe
Enroller Ed has to send report to Michael J
Enroller Mark has to send report to Michael J and Christian P
etc, etc
I have the following code but it's only designed to send the report to a recipient. How do I change the code so when Mary, Ed or Mark sends the report it goes to the designated recipient???? Do I have to declare variables?? and then set cases?? Is this task even possible to accomplish???...
Code:
Function mcrOpenRept()
On Error GoTo mcrOpenRept_Err
DoCmd.SendObject acReport, "rptMainStandard", "RichTextFormat(*.rtf)", "johndoe@something.net", "", "", "Re: Report", "Please see attachment.", False, ""
End If
mcrOpenRept_Exit:
Exit Function
mcrOpenRept_Err:
MsgBox Error$
Resume mcrOpenRept_Exit
End Function
The form and the report have a field name called EnrollerName. I know there must be a way to set the criteria for the code above based on this field. But, I have no idea how to do it.
Thanks in advance.
- Larry -
VBA Amateur