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
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Open a form4m 6s
-
(Locked)
Open a report4m 29s
-
(Locked)
Open a table3m 30s
-
(Locked)
Open a query3m 59s
-
(Locked)
Close an object6m 36s
-
(Locked)
Close a database or quit Access3m 34s
-
Run a menu command3m 17s
-
(Locked)
Print the active database object3m 21s
-
(Locked)
Display or hide warnings4m 26s
-
(Locked)
-
-
-
-
-