View Full Version : Best Mail List/Merge Strategy


Steve R.
07-13-2011, 02:45 PM
I have a split Access 2007 database. I am adding the ability for each person to print their own mailing list. The mailing list data itself is on the back-end. However, there also has to be a table on the local drive so that persons A's mailing list selections do interfere with person B's selections.

Below is the current code when opening the mailing list selection form. The subform datasheet has a check box for each name to determine who gets mailed a letter. Code works just fine.

My question, does this approach seem to be the best way to handle the situation; or are there other more efficient ways to do this? Do I really need to delete/create a table on the local drive or is there a way to do it from the back-end?

Additionally, I am contemplating how to update the local table, if there are changes to the back-end table. It may not even be necessary or may be overkill, since a new table is created every time this program is entered.

Rem Create Local Table for mail merge
strDestinationTableName = "tblLocalMailMerge"
strSourceTableName = "MailMergeMainQuery"
If TableExists(strDestinationTableName) Then
Rem Delete Table
CurrentDb.Execute "DROP TABLE " & strDestinationTableName & ";"
End If
If Not TableExists(strDestinationTableName) Then
Rem Create New Table
CurrentDb.Execute "Select MMIDNUM,MergeFlag,First,Last,DivisioNname,Section0 1,MMAddress1,MMAddress2,MMCity,MMState,MMZipCode INTO " & strDestinationTableName & " FROM " & strSourceTableName & ";"
End If
Rem ------------------------------------------------------------
Me.Child0.Form.RecordSource = "SELECT * FROM " & strDestinationTableName & ";"

plog
07-13-2011, 02:55 PM
I would keep all the data on the shared back-end and I would make tblLocalMailMerge have just one field--a number which corresponds to primary key of the main table. Then the mail list source becomes a query using just those records whose id are in tblLocalMailMerge.

On your subform, when a user check's a record's box it would trigger some VBA to either remove or add that record's number to tblLocalMailMerge.

Steve R.
07-14-2011, 04:08 AM
I would keep all the data on the shared back-end and I would make tblLocalMailMerge have just one field--a number which corresponds to primary key of the main table. Then the mail list source becomes a query using just those records whose id are in tblLocalMailMerge.

On your subform, when a user check's a record's box it would trigger some VBA to either remove or add that record's number to tblLocalMailMerge.
Great suggestion. I believe that would resolve a shortcoming with my current approach when the user makes a change/addition to the mail recipients name/address. Thanks.