apoc29
05-28-2007, 05:30 PM
hi everyone..
can the text in the listbox be printed?? not the entire form.
can the text in the listbox be printed?? not the entire form.
|
View Full Version : printing the text inside the listbox apoc29 05-28-2007, 05:30 PM hi everyone.. can the text in the listbox be printed?? not the entire form. The_Doc_Man 05-28-2007, 06:44 PM I don't believe Access supports this directly. There isn't a printer option for "selected control contents." Single page, yes. Whole report, yes. Whole form, yes. Single control? Nope. This function is, in my estimation, programmable but at a terrible programming price. You would have to keep a list of the controls that last had focus. Build a button that says "Print content of last control." Then in the OnClick event, check to see which control had focus just before the "Print content..." button. (Because of course, IT got focus the moment you clicked it.) Then you could use VBA code to create a small text file using the Open, Print, and Close commands. Then, using the FileSystemObject stuff, you could print and delete the text file. Are you SURE you really wanted to do this? It's an awful lot of work. apoc29 05-28-2007, 06:51 PM thats a whole bunch of work! im not that good in access.. hmmm.. i have a question, instead of using a listbox as an output of the query, wat else can i use? the trigger of the query will be coming from the combo box. the sample output would look like this: | Fruits | Description | Supplier | The_Doc_Man 05-28-2007, 07:04 PM If you have a query that has been limited to the things you wanted to see, perhaps via parameters, you can open the query in datasheet view, print that, and then close the view again. Ditto if there is a report already built that could be filtered to show only the stuff you wanted to see. Open the report with a filter, print it, and close it. Otherwise, probably no easy way to do it. |