TIP: Click on subject to list as thread! ANSI
echo: win_access
to: BRYAN HANKS
from: TONY TOEWS
date: 1996-11-17 12:07:00
subject: Re: Query Problem: ACCESS 95

 -=> Quoting Bryan Hanks to Bill Cheek <=-
 BC> I need to generate a report or query (preferably a query) that
 BC> looks exactly like this:
 
 BC> =CROP======GROWER===
 BC> Apples     Jones
 BC> Apples     Brown
 BC> Apples     Lynne
 BC> Bananas    Brown
 BH> 
 BH> Here is how you do it.  Throw out table1 (which lists the crops)
 BH> -- you don't need it.
Yes, you do need the crop table.  Or you should.  Or at least it will
save a lot of time and ensure valid data.  After all what if someone miskeys
the word Apple.  Data then is mixed up.  Setup a combo box referencing
the crop table when updating the grower/crop table.  This will save a
lot of time in doing data entry.
In addition the crop table, grower table and crop/grower table should each
have a counter as the primary key.  I call this an ID field, ie crop ID.
The crop/grower table then has it's own id, but the only two additional
fields on that table are the Crop ID and the Grower ID.   The Crop ID on
the crop/grower table defined with a relationship with the Crop table
and the same for the Grower ID.
 BH> Set up a report with the following:
 BH> 
 BH> Header:------------------------------
 BH> GROWER          CROP
 BH> Detail:------------------------------
 BH> =1=             =CROP1=
 BH> =2=             =CROP2=
 BH> =3=             =CROP3=
 BH> =4=             =CROP4=
 BH> =5=             =CROP5=
 BH> Footer:------------------------------
 BH> -------------------------------------
 BH> 
 BH> Where "=CROPx=" is the field with your crop fields.
 BH> The following fields are explained:
 BH> 1   -   GROWER
 BH> 2   -   IIF([CROP2]>"",[GROWER],"")
 BH> 3   -   IIF([CROP3]>"",[GROWER],"")
 BH> 4   -   IIF([CROP4]>"",[GROWER],"")
 BH> 5   -   IIF([CROP5]>"",[GROWER],"")
 BH> 
 BH> All fields (including the Detail section) have the 'Can shrink'
 BH> field set to YES.  Make sure to move the fields and size the
 BH> Detail area so there are no blank lines at the top or bottom
 BH> of the Detail area.
Good solution but, as per my other response, what happens if the grower
has more than 5 crops?  Like 20 or 40.
Tony
--- Blue Wave/Max v2.12 [NR]
---------------
* Origin: Vermilion Lighthouse, Vermilion, Alberta (1:3413/107)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.