Link to home
Start Free TrialLog in
Avatar of Castaway78
Castaway78Flag for United States of America

asked on

Mail Merge - Guidance on how to mark records as merged

Hi all -

So, here's my situation.

I have a SQL Server with a bunch of records. I need to create labels for the records. My department is always adding new records, and we're always needing to print more labels.

I created a Word 2007 mail merge document that creates such labels, and filters on a boolean (bit) field called LabelPrinted.  So, all my coworkers need to do is open the Word document, hit merge, and boom, done.

However, I am stuck at how to then mark the records as LabelPrinted=true

Can someone point me in the right direction for the most efficient and smoothest way to do this?

Is there some built in function within Word to do this? Or do I need to resort to VBA code? Or something else?

If VBA, what logic should I use? I'm experienced with VBA from Excel... I'm sure I can stumble through Word with some guidance.

I hope that all makes sense. I'm just looking for a starting point as to how I should go about this... I want to figure out the nitty gritty myself.

Thanks!

Avatar of BusyMama
BusyMama
Flag of United States of America image

I don't think there is a built-in function in Word for this.  I would go with VB - I have updated database records using VB in Excel and I am sure Word would be quite similar.

It sounds like you don't want specifics so I won't post any, but if you want more detail let us know.

Good luck!
Avatar of Castaway78

ASKER

Okay, so with VBA... how would I go about doing that?  (The actual code that does the SQL Update I'm good with)

Is there a AfterMerge event, or something similar that I could use to trigger the update? I'm just trying to figure out how I would go about doing that?

Or would I need to create a custom interface that starts the merge and updates the SQL all in one?
ASKER CERTIFIED SOLUTION
Avatar of BusyMama
BusyMama
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The recordset is being called via the merge itself... at this point, I haven't created any VBA code.

So, it's looking like putting in an Update command into the AfterMerge event will work nicely.

Thank you!