Results 1 to 3 of 3
  1. #1
    iProRyan is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2011
    Location
    England, United Kingdom
    Posts
    44

    Exclamation Help - Printing a letter in a form

    Hello,

    I am new to the forums so sorry if this has already been posted somewhere or it is in the wrong section, but I really could do with some help.

    For a project, I am making a database for a DVD Rental Store, and I have a form that adds new guests, on this form I would like a button to print a letter that I have in word but for each different guests so it prints them a letter confirming there registration and include account numbers which will be different everytime, any idea how I would do this, if it makes sense.

    Any help will be much appreciated.

    Ryan

  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,640
    Generally you can mix fixed text and data in a textbox:

    ="Your confirmation number is " & [ConfirmationNumberField] & " for your rental on " & [RentalDateField] & "."
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    robsworld78 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    181
    Hi, welcome to the forum!

    I'm not the best with access but this is what I would do.

    Create a query with all the fields you need to show up in the letter, make sure you have the GuestID in the query.

    Then create a report and use the query you created as the record source. Then type out your letter and place text boxes where you want to insert the account numbers, etc... The query will show all records in the table and when you open the report normally it will likely repeat the letter for every record in the table, don't be worried about that the magic comes on the form you want to print from.

    Now on the form you add the guest add a button and on the "on click" event use the code builder and add the following code.

    DoCmd.OpenReport "REPORTNAME", acViewReport, , "[GuestID]='" & Me.GuestID & "'"

    Now when you click the button it should open the report with only the info you see on your screen.

    "acViewReport" in the code above will show the letter in a form view on the screen, you can change that to make it print directly to printer and not show on screen.

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

Similar Threads

  1. Printing a form letter
    By tomcoll in forum Reports
    Replies: 8
    Last Post: 10-18-2011, 09:12 PM
  2. Printing from a form
    By paradox6996 in forum Access
    Replies: 3
    Last Post: 05-04-2011, 02:07 AM
  3. Replies: 0
    Last Post: 01-20-2011, 01:24 PM
  4. How to change drive letter in input form
    By Vernon27 in forum Access
    Replies: 16
    Last Post: 06-09-2010, 12:05 PM
  5. Replies: 0
    Last Post: 03-06-2010, 01:11 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