Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress common information in continuous form 1

Status
Not open for further replies.

freddydog

Programmer
Jan 28, 2007
14
Hello
I would like to display mailing history information for various Clients. Like in a report, I would like to display the name and address only on the first entry of this continuous form for a varying number of mailing history till I get the next Client information.
I though of doing a union where the first select included name and address with the first column of mailing history (First aggregate command) and the second select would substitute blanks for the name and address columns. This seems to work but I worry about performance in the future when mailing history gets longer and longer.
Is there a better way?
 
Are you saying that you have the same name and address in multiple records in a single table?

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
missingling, I joining two tables, one has name and address and the other the mailing history. When I display the information on a form, I would like to show the name and address only for the first mail history record. For subsequent mail history records for the same individual, I would like to leave the name and address blank (rather than repeating name and address for every history record.

Hope this is clearer. thanks
 
Remou's right; that's why I asked the question I did! People use subforms for all kind of crazy reasons, but this is the very thing subfomrs were created for! And Access will do all thehard stuff for you!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks for your suggestions but I want to have a number of forms for viewing mail history. I already have a form with subform layout (e.g. find Client and see mailing history).

This additional form is to allow easy scrolling through a specific set of mail history records e.g. records selected by type or date range. A form/subform combination does not allow easy scrolling. I could just have a continuous form of mail history records but the additional piece of information (name and address) would make it more useful.

How inefficient are aggregate commands such as First, Last, etc?
 
Here is an untested idea;

Code:
SELECT   A.ID,
         A.SFName,
         IIF((SELECT (COUNT(* ))
              FROM   tblTable
              WHERE  SFName = A.SFName
                     AND ID >= A.ID) = 1,[SFName],"") AS [Name]
FROM     tblTable AS A
ORDER BY A.SFName;
 
Remou, tried your suggestion with IIF and it worked ... really clever! Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top