How should I create this report module?

barbados2010

Registered User.
Local time
Today, 04:31
Joined
Sep 7, 2012
Messages
16
What I am trying to accomplish is create a report in access that uses a particular customers data to create a report using their info to populate some fields where their name and address would go. I am a newbie to VBA so I was wondering how best to go about creating this action. Should I just add it as a button in the proper form? What about have it open directly into a pdf?

Below is what I was able to find..

Code:
- On your form you have a command button to generate the report.
- In the reports module you define: Dim prev_form as Form.
- On a click you open the report, passing the form's name through OpenArgs.
- In the Load event you assign:  Set prev_form = Forms(OpenArgs).
- From now on all controls of the form are available within the report.
- In the Load event you can then assign:
    Me.Blank = prev_form!Name & nlcr prev_form!Adress & nlcr prev_form!City, or whatever you want to use.
 nlcr = Chr(10) & Chr(13)
 
The way I have implemented reports (at a high level) is as follows:
1) Query the database in order to obtain the records needed to produce the report. Select those records into an FE temp table
2) Design a report bound to the FE temp table. Perform exact grouping and sorting operations in the context of the report query.
3) Output may be printed or PDF... does not matter.

So, the button that opens the report first runs the queries necessary to populate the FE temp table, then if that was successful opens the correct report.
 

Users who are viewing this thread

Back
Top Bottom