Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 May 12th, 2005, 12:50 AM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to generate sequence reports

I need help to generate a sequenced text outout from Access. And I am absolutely newbie to VB.

I have 6 tables of records derived from a mastertable of data e.g. tbl 1, 2, 3, 4, 5, 6. These 6 tables records are from 1 record in the master table in Access.

I need to generate the report in the following sequence :

Tbl 1, 2, 6, 3, 4, 5. Can VB do such sequencing? I understand you can use Do While... Loop but I do not know how to write the code to prepare the output into Text.

Sometimes there can be more than 1 table 3 or 4 and also 6 will not be in the sequence if there are no data in the table, same goes for 3 and 4.

So a variety of sequencing can occur like:

1,2,6,3,3,3,4,4,5

or

1,2,6

or

1,2,3,4,5

or

1,2,4

and so on.

The output into text will be in rows of 1250 characters (all tables are limited to 1250 characters already)

i.e.

in text output: (only from 1 record in mastertable - there can be more 600 records in the mastertable)

1 (text)
2 (text)
6 (text)
3 (text)
4 (text)
5 (text)

Is there anyway to prepare this text report. Its near impossible to work out the text output in Access or Excel.







 
Old May 12th, 2005, 06:55 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   I am not sure what you are trying to do.

   If I understand correctly, you have a master table (let's call it "tblMaster") and 6 tables that look up to the master table (let's call them "tbl1", tbl2", etc.)

   Is this what the tables look like:

tblMaster
   MasterID - PK
   OtherFields - ???

tbl1
   1ID - PK
   MasterID - FK
   Text - text

tbl2
   2ID - PK
   MasterID - FK
   Text - text

etc.

  Is this correct?

  If so, it seems like you want to grab a PK from tblMaster, and then pull text from the sub tables in numerical sequence if there is a record using MasterID as the FK. Are any other fields needed or do you just want lines of text in numerical sequence from the sub tables?

  Is this correct?

  Do you want this output to go to a .txt file? .csv? Access report?

All this info is needed to write the code, but it is certainly doable in VBA.

Thanks,


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
comparison using a sequence pcase XSLT 1 December 3rd, 2007 07:33 PM
how to generate reports from access using queries nebujacob2000 Access VBA 3 November 18th, 2005 05:11 AM
value from a sequence suhabassam JSP Basics 0 September 27th, 2005 01:33 AM
How to generate data reports gandhichirag Pro VB 6 0 July 5th, 2004 08:08 AM
Generate reports from Listbox Or WhereClause help nkrukovsky Access VBA 1 November 6th, 2003 06:36 PM





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