Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2006

Tip: Looking for answers? Try searching our database.

Best Design Approach

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Bloom - 12 Apr 2006 15:28 GMT
Inherited DB with multiple tables that hold similar data.  Need best design
approach to creating a report.

Pseudo Code for macro:
Set Warnings Off
Empty temp table
Merge Table A with Table B (only fields needed for report) in Temp Table
Report from Temp Table
Set Warnings On
End

Is this a valid approach?  I am not allowed to redesign the database, only
add the new report.
Allen Browne - 12 Apr 2006 15:45 GMT
Ed, that's doable, but could you just use an UNION query?

Create 2 queries: one based on table A, and the other on table B.
Make sure both queries have the same number of fields, in the same order, so
they mach.

Switch both queries to SQL View (View menu.)
At the end of the first query, delete the semicolon, and enter:
   UNION ALL
Copy in the SQL statement from the 2nd query.

You will end up with something like this:
   SELECT F1, F2 FROM TableA
   UNION ALL
   SELECT F9, F3 FROM TableB;

Save the query, and build the report on that.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Inherited DB with multiple tables that hold similar data.  Need best
> design
[quoted text clipped - 10 lines]
> Is this a valid approach?  I am not allowed to redesign the database, only
> add the new report.
John Vinson - 12 Apr 2006 23:41 GMT
>Inherited DB with multiple tables that hold similar data.  Need best design
>approach to creating a report.
[quoted text clipped - 9 lines]
>Is this a valid approach?  I am not allowed to redesign the database, only
>add the new report.

The temp table is unnecessary; can you not instead simply use a Select
query joining the tables, or a UNION query if they contain the same
kind of data? A Report need not be based on a table; in fact it will
ordinarily be based on a Select Query.

                 John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.