Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    4

    Unanswered: creating a letter in access report

    Hi,

    I have a database of students..now when i add a new student to the database i want i want to press a button and print a predefined letter just adding the students name and address at the top. now i have tried a mail merge but that gives me all the records in the database.. i only want it for the current record showing in the form. i would also prefer to do this without using word.. is it possible to do it in a report? if not whats my alternative?

    hope someone can help

    Omar

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: creating a letter in access report

    Very Easy, just create a report and put all the text in number of text boxes. Bound one of these boxes to the nameof the student. Base your report on a query with a where clause to pull only the record of the student you have on your screen.


    Originally posted by omar78
    Hi,

    I have a database of students..now when i add a new student to the database i want i want to press a button and print a predefined letter just adding the students name and address at the top. now i have tried a mail merge but that gives me all the records in the database.. i only want it for the current record showing in the form. i would also prefer to do this without using word.. is it possible to do it in a report? if not whats my alternative?

    hope someone can help

    Omar

  3. #3
    Join Date
    Oct 2003
    Posts
    4
    no that wont work becuse the same student can appear again and again in the database.. so each time they appear a letter needs to go to them..

  4. #4
    Join Date
    Oct 2003
    Posts
    4
    yes i apologise khan, your idea does work..

    not set it up fully.. but it did just display the current record in the query..and the report.

    many thanks!!

  5. #5
    Join Date
    Oct 2003
    Posts
    4
    im still having problems with the formatting of the report.

    i want the text box to adjust with the size of the name.. i have tried auto shrink and grow but that hasnt worked.

    example.

    Dear Parents / Gaurdians,

    Please be aware that [Name] has been involved in a serious incident at school........etc etc...

    so how do i get it so theres just 1 space before and after the name..

    can anyone help me on this please?

  6. #6
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    This is a little bit tricky. You may have to try adjusting the length of the text box containing the name of the student depending on the fonts you are using. With a little bit of trial and error you should be able to know how much should be the width of the control for how many characters. You can use Len(name of student) to get the string length.

    Then you subtract this new width from the default width of the control. This will give you the amount with which you have to move your conrol containg the text "...has been involved .." to the left.

    The same technique can be reversed for names which are far larger than the default width of the control.

    If you don't want so much complxity, try defaulting the name control width to something that can fit every name. Then you just have to shorten the width.

    Try doing all this ON_PAGE event of the report.

    Thismay work.

    Originally posted by omar78
    im still having problems with the formatting of the report.

    i want the text box to adjust with the size of the name.. i have tried auto shrink and grow but that hasnt worked.

    example.

    Dear Parents / Gaurdians,

    Please be aware that [Name] has been involved in a serious incident at school........etc etc...

    so how do i get it so theres just 1 space before and after the name..

    can anyone help me on this please?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •