 |
| 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
|
|
|
|

December 13th, 2006, 10:20 AM
|
|
Authorized User
|
|
Join Date: Oct 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Grouping Within a Report for labels
Hi all,
I've got a question that's been a bit difficult for me to figure out. I've got a table structure like the following:
Device Type Panel Tag Location Comm
Yellow Wing 12 STR301 A939 909-3435
Yellow Wing 12 STR302 A939 909-3436
Red Foot 12 STY301 A938 909-2543
Etc. I'm trying to use a report to generate lables setup like the following:
Yellow Device
Wing Type
STR301 909-3435 Tag(s) Comm(s)
STR302 909-3436
Basically I need only one instance of the device but all the tags associated with it on the lable. I have the tag format made but I can't seem to get the grouping down. Any ideas?
Thanks in advance for your help,
ermy
|
|

December 13th, 2006, 12:00 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What do you mean by "on the label?"
If you mean report, then group by Device, then by Type, then use Tag and Comm in the Detail section.
mmcdonal
|
|

December 13th, 2006, 12:51 PM
|
|
Authorized User
|
|
Join Date: Oct 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The label is setup to receive 4 lines. I figured out how to group like you said mmcdonal. Thank you :) but that does not completely solve my problem (another one arose in the process). I have labels that are of the dimensions 1"H x 2.5"W. I fit the Device, Type, and one tag and one comm such as:
Device
Type
Tag
Comm
But since some have multiple tags and comm's they need to group together, without repeating the device and type. So ideally I would have two labels (1" x 2.5") - I'll call them sticky labels from here on out - spit out
----------- -------------
| Device | | Tag2 |
| Type | | Comm2 |
| Tag | | Tag3 |
| Comm | | Comm3 |
------------ -------------
whether the sticky labels are in a column or in a row is irrelevant to me, but I need to be able to put them out in that sort of format. As is now, if I don't have a third tag it places the next Device's name there. So I'm trying to find if there's a way to insert a blank space when there is not a tag and put the tag there if there is a tag. If it would be easier to see what I'm talking about, I can send screen shots of the print preview and the design window.
|
|

December 13th, 2006, 02:37 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
You could do this with code and a temporary table, but I am not sure if you want to get into coding this.
You can also use the Can Shrink property. Does that help?
mmcdonal
|
|

December 13th, 2006, 03:45 PM
|
|
Authorized User
|
|
Join Date: Oct 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Not really. I already tried using the shrink property. How would I go about using code and temporary table?
|
|

December 13th, 2006, 03:49 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
It depends on whether you need to code for N number of Tag/Comm per Device/Type, or just 3, as you have in your label structure.
Will there only ever be a maximum of 3 Tag/Comms per Device/Type pair?
mmcdonal
|
|

December 13th, 2006, 03:52 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Also, is there any chance of redesigning this so that the Device and Type are look ups, or are they already?
mmcdonal
|
|

December 13th, 2006, 04:00 PM
|
|
Authorized User
|
|
Join Date: Oct 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No, they're not lookups. I don't know how to do that yet. There's a max of 4 tags/comms per Device/type pair. If there's an easy way to make it a lookup I'd be more than happy to design it that way.
|
|

December 13th, 2006, 04:04 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Yes, if the Device names and Types are unique.
Create a Make Table query just pulling the Device column, set Unique Values to Yes, and create the table.
Then change the field type on the first table to look up have it look up the to the new table.
Do the same with the Type column.
Then the queries get easier.
mmcdonal
|
|

December 13th, 2006, 04:25 PM
|
|
Authorized User
|
|
Join Date: Oct 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay. I've created the table with only the Device/Type. I did a lookup and now I'm using Tag as the unique identifier (some tags share comm's) and labled it Tag. I now have a drop down list (combo box) in that table. Does that sound like I did it right? What's the next step?
|
|
 |