Solved

Printing in Access 2002

Posted on 2004-09-23
9
246 Views
Last Modified: 2008-03-04
I have an application that has a custom query builder with a nice user interface.  The resultset is returned in a grid view in the detail section and usually has a horizontal scroll bar depeding on how many fields they include.

I am trying to find a way to print the resultset without actually formatting a report object and calling that.  Is there anyway to do this?  It currently calls the docmd.runcommand accmdprintpreview, but this cuts off some of the columns in the resultset.  Any input would be helpful...
0
Comment
Question by:ACCESSIBLESOLUTIONS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 2

Expert Comment

by:kevinredfern
ID: 12131749
could you use a subreport, this way you would not have to format it, jus tset it to grow or shrink depending on the data that you ask it to bring in.

I hope i have understood your problem.
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12132128
you could create a report object at runtime.  It's a lot of code, but it might work for you.  You could even get fancy in making it automatically switch to landscape if the number of fields would fit in portrait.

Mike
0
 

Author Comment

by:ACCESSIBLESOLUTIONS
ID: 12135168
The challenge is the number of columns vary (by design) with each run of the code so subforms or report objects can't be used.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 18

Expert Comment

by:Data-Man
ID: 12135494
How about just exporting it to Excel and printing it from there?

Mike
0
 

Author Comment

by:ACCESSIBLESOLUTIONS
ID: 12136160
Interesting question since that is an option already on the form in addition to the print preview button. The problem is we have some users complaining Excel is an extra step they shouldn't be required to do - and everyone knows users are never wrong!
0
 
LVL 18

Accepted Solution

by:
Data-Man earned 125 total points
ID: 12136200
Exactly....My apps are pefect except for one problem...the user.

Use automation with excel for the report button......the users wouldn't even know it was excel....the only thing they would see is the print dialog from excel.  I do that now with MS Word when I generate contracts from Access.  Word is opened behind the scene and the contract is created.  I then throw up the print dialog from word, right on top of the access form....they don't even know they are in word.  

I overheard one user telling another that the entire application was written using excel tables....I about fell out of my chair laughing...the things users think of.

Mike
0
 

Author Comment

by:ACCESSIBLESOLUTIONS
ID: 12194851
Data-Man: You wouldn't happen to have any sample code with the automation technique you could share by any chance. I'd like to try it.

Thanks,
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12196591
Sorry I don't have any sample code....I have the code to create contracts via MS Word, but it is so customized for my client that if I post it here, it would require too much explaining for an EE question.

On the flip side, just create an object variable of type Excel.Application.
If you export the data to Excel and then turn on the macro recorder...do what you need to get the data printed correctly.  Stop the macro recording process and then copy and paste the code into Access and use your Excel object to prefix the code....you will have to tweak the code and also export the data into excel as part of the process, but this should be enough to get you started.

Mike
0
 

Author Comment

by:ACCESSIBLESOLUTIONS
ID: 12467094
Thanks for the help on this
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question