Results 1 to 7 of 7
  1. #1
    Kettrick33 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    2

    Producing Letters from Access

    Hi All,



    Very new to Access (I've done one simple database in the past), but because I know my way around a PC I've been tasked with replacing our MyPHP database and using Access to hold all the required information.

    I'm looking to be able to use a Form that my colleague can input all the information into and once he's done this, be able to print a letter to the company with a specific reference number and additional information.

    Apart from some wording on the letter staying the same, the rest would need to be able to automatically add in the data my colleague has input into the form.

    I know how to create the form and the database etc, what I can't work out is how to get the letter part to materialise. Can someone point me in the right direction?

    I have added a screenshot of the previous form we used to fill and a screenshot of the letter.

    I hope I've wrote this so it's easy to understand what I'm looking to do.


    Click image for larger version. 

Name:	Consent Details.jpg 
Views:	18 
Size:	178.8 KB 
ID:	38947Click image for larger version. 

Name:	Generated Letter.jpg 
Views:	19 
Size:	91.8 KB 
ID:	38946

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can base a report on the table or a query with criteria. In a textbox you can have:

    ="Dear " & [FieldNameFromTable] & " some more text here"

    You can get pretty creative, but that's the basic way of combining fixed text with data.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    the other way is to include in your text a placeholder, then use the replace function e.g

    text is stored in a field called say lettertext

    Dear [Salutation],

    I write to you about....
    and you would then use the replace function

    fullletter=replace(lettertext,"[Salutation]",salutationfield)

    for many changes, either use nested replaces or a loop depending on whether this is being done is a query or vba

  4. #4
    Kettrick33 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    2
    Thanks for the responses, however, I have no idea how to do either of those. Do you know of anywhere that I could read up on how to do something similar to what I'm trying to do?

    Thanks again.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    can't suggest anything specific but suggest you google/bing 'access vba concatenation' for Pauls suggest or 'access vba replace function' for my suggestion.

    you will probably also want to look at allen brownes 'concat related' function which may be helpful for your additional conditions - http://allenbrowne.com/func-concat.html

    You can also look at using a report for the letter which may be easier for you. I would expect your db to have 5 or 6 tables and unlike forms you can use multi table queries as the recordsource.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    You know how to create a report 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.

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Another option is Albert Kallal's Super Easy Word Merge available here...http://www.kallal.ca/msaccess/msaccess.html
    This would be especially helpful if you have many different documents.

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

Similar Threads

  1. Replies: 15
    Last Post: 12-17-2018, 05:03 PM
  2. Replies: 8
    Last Post: 09-19-2016, 08:25 PM
  3. Replies: 4
    Last Post: 06-23-2016, 08:51 AM
  4. Greek letters in access VBA
    By msasan1367 in forum Access
    Replies: 1
    Last Post: 08-09-2013, 08:19 AM
  5. Producing a stand-alone Access Program
    By GordonT in forum Access
    Replies: 3
    Last Post: 08-20-2012, 02:23 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