Create a single letter from a form

spnz

Registered User.
Local time
Today, 07:16
Joined
Feb 28, 2005
Messages
84
Hi there

I am hoping someone can point me in the direction on where I could find an example on what im trying to do.

I have a form and also a report. The report has been made up to be a reference letter for employees. I would like to be able to take certain information from the form e.g Name,Address, Start Date etc etc and merge it into the report. The letter is only 1 page long so I would like to keep it to only using access and not word.

I would really grateful if anyone could help out as I am really struggling to work this out for myself.

Thank you
 
Assuming the form is open at the time the report opens, simply reference the form's fields on the report:

[Forms]![NameOfForm]![NameOfField]
 
Thanks Richo

I will try that out and get back to you.


Thanks again
 
Same Problem, Additional Question

I'm trying to accomplish the same thing, but when I pull up the report, it includes every record that follows the current one. For example, if I'm looking at record #3, and only want to print record 3 to the report, I click the button and record 3, 4, 5, etc are all printed. Is there a way to limit this to just the record being viewed?

APryor
 
You need to filter the records going to the report using a "unique identifier" for the record you want to print in the report. You can do this right from the DoCmd.OpenReport command line.
 
For instance, say you want the current record to print on your report. What is the primary key field in your table that differentiates that record from all other records? In many employee info tables a social security number is used as an employee ID #. In other tables it may just be an auto-number field.

To open a report with the current record in such a case the syntax would be something like:

DoCmd.OpenReport "Report Name", acPreview, , "[EmployeeID] = " & Me.EmployeeID
 

Users who are viewing this thread

Back
Top Bottom