Results 1 to 6 of 6
  1. #1
    hotWater is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2015
    Posts
    3

    Update MS Access field when mail merge letter is printed


    Hi,

    I am using an MS Access 2010 table as a data source for a mail merge. I would like to update a field in the table with the date that the letter is printed. Is there a way to do this?

    Thank you!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Certainly. Need code. The real trick is figuring out what event to put code into. I assume you have code that opens and prints the mail merge? Is that field already available on open form?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Thats tricky because just because you click print, doesnt mean the letter actually printed. So youd have to manually verify that the paper actually printed.
    BUT
    A manual MACRO in word:
    If you have a select query you use in access that is the 'letter batch', then you could build a macro that uses an update query, that uses the 'Letter batch' query as the source, to mark them 'printed'.

    Code:
    Public Sub UpdRST()
    Dim con As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim DB
    Dim vProvid
    
    Set con = New ADODB.Connection
    Set rs = New ADODB.Recordset
     
     uid = "HomerJSimpson"
     pwd = ""
     DB = "\\myserver\production\Generic104J.mdb"
     vProvid = "Microsoft.Jet.OLEDB.4.0"     '  "SQLOLEDB"
     
      
    With con
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .Properties("User ID").Value = uid
        .Properties("Password").Value = pwd
        
        .Open "Data Source=" & DB 
    End With
     
    con.Execute("quMarkNamesPrinted")
    
    rs.Close
    con.Close
    
    set rs = nothing
    set con = nothing
    End Sub

  4. #4
    hotWater is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2015
    Posts
    3
    Hi,

    I'm newish to this, so please bear w/me. I'm using the "Word Merge" from MS Access 2010 to link to an existing Word document.

  5. #5
    hotWater is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2015
    Posts
    3
    Should I not be using the Word Merge Wizard?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Can if necessary. I've never used it. I build reports in Access.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 09-22-2020, 03:31 AM
  2. Access truncating field in mail merge
    By Johnmc1953 in forum Import/Export Data
    Replies: 0
    Last Post: 03-21-2015, 09:20 AM
  3. Mail Merge - Access 2010 - drop down field
    By lynnmc26 in forum Access
    Replies: 2
    Last Post: 01-14-2014, 05:54 PM
  4. Replies: 1
    Last Post: 07-10-2012, 05:51 PM
  5. Setting up a mail merge or report letter
    By AndrewsPanda in forum Access
    Replies: 8
    Last Post: 09-29-2011, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums