barbados2010
Registered User.
- Local time
- Yesterday, 23:32
- 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..
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)