Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2003, 02:35 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default DAO and Creating reports

I am trying to open an existing report and then save this report with a different name and record source using DAO. I searched in msdn and various textbooks and it seems that i cannot 'create' new reports using DAO....any help would be appreciated.

 
Old December 3rd, 2003, 02:54 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure what you are trying to say.
I use ADO for my reports and it works fine. I do not see why Access would not let you use DAO. Still, I recommend using ADO. It is better.



Sal
 
Old December 3rd, 2003, 03:25 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Basically what I am trying to do is
a) Open an existing report
b) Save this report with a different name and a different record source.

thus, the reports would be identical except for the name and record source, which would be different.



 
Old December 3rd, 2003, 03:38 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you doing this programatically?



Sal
 
Old December 3rd, 2003, 04:24 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, i'm trying to do this programatically...so far i got the copying report part rigth:

DoCmd.CopyObject , "New report name", acReport, "Old report name"



 
Old December 4th, 2003, 07:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you really need to copy the report?
Couldn't you just change the recordsource as the report is loading?

I am a loud man with a very large hat. This means I am in charge
 
Old December 5th, 2003, 10:50 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To create code to save a report programatically means that you would be doing this a lot for the same report. The report would be saved exactlu tne same as the previous. It would show the same data. Steven is right. Why do you need to do this this way?
At times, programmers say that what they need to do is ... but they forget what the business requirement really is.
Please be more clear on the business requirement of your needs. A simpler solution may exist.



Sal
 
Old December 5th, 2003, 12:11 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The requirement is for the user to be able to create and save a report based on an existing one. The report 'format' would be the same, but the record source and hence the data in the report, would be different. So yeah, there would be many reports with the same format but containing different data (ie different Sales managers and sales employees).

Currently there is only one Sales report; so i figure why don't i just copy the existing Sales report, create a new query based on the values the user enters in a form, and then save the report with a different name and with the record source set to the query just created? Maybe I am only seeing it one way, and probably there is a better way to do this....but i don't see it! :)






 
Old December 5th, 2003, 12:19 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

See, the requirement is to run a report based on different criteria. Create different queries, or delimit them, filter them differently and then you just change the title of the report as needed to describe it's contents. Then from a form have them select the query, recordsource, or parameter of some type. Maybe they can select a title from a dropdown and then this somehow. changes the recordsource and title.

Remember K.I.S.S.

By the way, I am not rude, I just type fast and short. Do not let the used dictate the outcome of your app. They need only define their requirements.

If a user says, I need a report that I can sort and this and that, well, they may just need a form in datasheet view that they can export to excel.

Hope this helps.



Sal
 
Old December 5th, 2003, 12:37 PM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no offence taken :)....That's exactly what i needed: a different way of seeing things! I felt like i was stuck on what i was doing and couldn't think of what to do next....i'll try your suggestion

Thanks Sal








Similar Threads
Thread Thread Starter Forum Replies Last Post
creating cached version of reports barmanvarn Reporting Services 1 January 4th, 2007 08:58 PM
Creating reports using dataset Bhavin Crystal Reports 0 October 27th, 2004 02:32 PM
Creating Reports in Word mckly VB Databases Basics 1 June 23rd, 2004 05:17 AM
creating dynamic reports for different databases anneline Crystal Reports 2 September 27th, 2003 12:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.