dan_l
Active Member
Hi,
This is all an Access based project, but this really more about the VBA side.
Here's what I've got:
-Class that manages a series of reports out of access.
-A Class that emails the files exported to a bunch of users.
General program flow:
A header procedure loops through a table containing report parameters (query names, table names, etc), and does all the work via the first class. The first class passes some details over to the second class which generates emails, adds attachments, etc.
So. Each email body is a little different. I try to be as generic as possible but a lot of them require customization. So I'd say of 15 to 20 outputs, about half of them have a unique email.
My question:
How do I best store these texts?
Right now I've got the email written in a horrible, maintenance intensive function:
But I think there has to be a better way. How would you guys approach this?
This is all an Access based project, but this really more about the VBA side.
Here's what I've got:
-Class that manages a series of reports out of access.
-A Class that emails the files exported to a bunch of users.
General program flow:
A header procedure loops through a table containing report parameters (query names, table names, etc), and does all the work via the first class. The first class passes some details over to the second class which generates emails, adds attachments, etc.
So. Each email body is a little different. I try to be as generic as possible but a lot of them require customization. So I'd say of 15 to 20 outputs, about half of them have a unique email.
My question:
How do I best store these texts?
Right now I've got the email written in a horrible, maintenance intensive function:
Code:
function GetEmailString(sRepName as string)
dim sresult as string
select case srepname
case report1
sresult = Report1Text
case report2
sresult = Report2Text
end select
get emailstring = sresult
end function
function report1text()
report1text = "The quick brown fox jumped over the lazy dog"
end function
function report2text()
report2text = "blah blah blah"
end function
But I think there has to be a better way. How would you guys approach this?
Last edited by a moderator: