Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 June 19th, 2006, 07:34 PM
Registered User
 
Join Date: May 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generate 1 report for each record in a recordset

Currently, I run a module which generates a letter (in preview mode) using, as the source, a select query.

The user has to preview each report/letter generated for each record returned by the select query.

However, I now need to create/export a .rtf file for each report/letter previously displayed in preview mode.

I figure I have to create a recordset using the query (or an inline SQL query). I then want to read through each record in the recordset and generate the report/letter and export it to an .rtf file.

Each .rtf filename will be unique as each record in the recordset will be unique based on client id.

The client id will form part of the .rtf's filename.

Then, for each record in the recordset I need to update a value in one of the fields and reflect this back in the original database table.

Could someone please provide the code to do this? I am using DAO recordsets.


Thank you

Gill
 
Old June 20th, 2006, 01:41 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Are you using 100% MS Access?
Access accessed through VB6 or .NET?

These sort of details really change the appropriate approach.
 
Old June 20th, 2006, 04:57 PM
Registered User
 
Join Date: May 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry Brian. I am using Ms Access 2003 which uses Visual Basic 6.3

 
Old June 23rd, 2006, 01:01 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Gill,

Check this link..
http://www.geocities.com/raghavendra...ort_To_RTF.zip

I just done this by reading your post. If anything which is not the way you
expected, then let me know, will do the changes.

It takes the all data from table and filters the report with each record
and exports to .rtf file and goes to second record. (i guess this is what
you looking for)

It puts all .rtf files in MyDocuments (by default).

This db is done in Access-XP, with dao3.6 and open the db and go to the forms section, and open the form1 and click that button. Just
see is this the way, and check the remaining things, like table,
report, code.

Hope this helps.


With Regards,
Raghavendra Mudugal
 
Old June 23rd, 2006, 01:15 AM
Registered User
 
Join Date: May 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much, Raghavendra .

This is a very usual piece of code.

I gather I can use the initial query that my report currently uses and place output in a temporary table. I can then change my report to read the temporary table instead.

Gill

 
Old June 23rd, 2006, 01:22 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Gill,

I did'nt understood what you ment. Its better check the code (that link)
and let me know if any.

Hope this helps.

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i generate OLAP Report manoj_k79 Classic ASP Basics 0 December 15th, 2006 08:28 AM
move to particular record number in recordset goodrags VB How-To 3 June 27th, 2006 09:11 PM
How to generate a report using vba ? method Access VBA 1 May 3rd, 2005 04:48 AM
"Single-Record" Recordset Wyatt70 Classic ASP Databases 2 November 18th, 2003 01:20 PM





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