From the course: Access: VBA

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Print the active database object

Print the active database object

From the course: Access: VBA

Start my 1-month free trial

Print the active database object

- [Instructor] You can view the objects in an accessed database quickly, but you can't distribute that data or summaries easily. If you do want to share summaries of your data, you can do so by printing a form or report on paper, or as a PDF file. If you want to enable your users to do that through VBA code, you can use the do command dot PrintOut method. I'll demonstrate how to do that in this movie, and you can see that I've opened the Categories form to work with. I'll press Alt + F11 to move to the Visual Basic editor, and then to insert a code module, I'll go to the Insert menu and click Module, and a new code module appears. I'll do this work within a subroutine, so I'll just call it Sub PrintObject, and open and close, left and right parentheses, because I'm not passing along any arguments. And I'll press enter a couple of times to give myself some white space. And now I can type the command that I want to use in VBA, and that is DoCmd.PrintOut. This line of VPA code is all…

Contents