help with concatonate

L

Linda

I believe this is what I need to do, but even though I have read the other
messages and tried Duane's website example, I don't get how my issue would
work.

I have many fields in a report that are tied to the RECID, unique
identifier. When there ismore than one location field, Township, range and
section, it reprints all of the information, including financial, as another
record with the same RECID information. Needless to say, this is really
screwing up my totals!!

I have a main table tblFARGASmain, and a location table, tbllocality, that
both have RECID as the primary key.

How would I write this as an expression?

Thanks,

Linda
 
L

Larry Linson

I believe this is what I need to do, but
even though I have read the other
messages and tried Duane's website
example, I don't get how my issue would
work.

I have many fields in a report that are tied
to the RECID, unique identifier. When
there ismore than one location field, Township,
range and section, it reprints all of the
information, including financial, as another
record with the same RECID information.
Needless to say, this is really screwing
up my totals!!

I have a main table tblFARGASmain, and
a location table, tbllocality, that both have
RECID as the primary key.

How would I write this as an expression?

How would you write _what_ as an expression? Without a moderately detailed
description of your tables and fields, we may even have some difficulty
following what you are asking.

Larry Linson
Microsoft Access MVP
 
L

Linda

Sorry if I wasn't clear.
This is what is happening - I am printing a report repFARGASlandpurchase,
based on a query called qryFARGASlandpurchase. There are 2 tables,
tblFARGASmain and tbllocality. Both have a primary key called RECID. This
is what I get when I print:

RECID Name township range section fedshare stateshare
2000 Anyone 12N 13E 9 20,000
10,000
2000 Anyone 12N 13E 8 20,000
10,000
2000 Anyone 12N 13E 7 20,000
10,000

As you can see, the only thing that changed was the section, but all of the
information tied to this RECID gets repeated.
What I would like it to do is:

2000 Anyone 12N 13E 9,8,7

I would also write the same expression for township and range, as they can
also change.

I hope that was a bit clearer:)

Linda
 
L

Linda

Duane, I did look at that example, but it seemed to want to create a new
field by splitting out the first names, etc. I understood the first part of
the example, but couldn't get the last part to work for my situation. Your
example had more information than I needed, I think.

Linda
 
D

Duane Hookom

Explain the "last part ... my situation". Please provide sample records
again and how you would like them to appear in the report.
 
L

Linda

Thanks, Duane.

I wasn't sure how much info you would need, so I am just re-stating what I
had said before.
This is what is happening - I am printing a report repFARGASlandpurchase,
based on a query called qryFARGASlandpurchase. There are 2 tables,
tblFARGASmain and tbllocality. Both have a primary key called RECID. This
is what I get when I print:

RECID Name township range section fedshare stateshare
2000 Anyone 12N 13E 9 20,000
10,000
2000 Anyone 12N 13E 8 20,000
10,000
2000 Anyone 12N 13E 7 20,000
10,000

As you can see, the only thing that changed was the section, but all of the
information tied to this RECID gets repeated.
What I would like it to do is:

2000 Anyone 12N 13E 9,8,7

I would also write the same expression for township and range, as they can
also change.

I seem to remember in the recesses of my brain that there was a "supress" of
some sort in R-base (that is going back a long way!), but I could easily be
confused with something else. It is, after all, Friday.

Linda
 
D

Duane Hookom

Were you able to get the section field to concatenate?

You stated "I would also write the same expression for township and range,
as they can also change" but failed to provide an example.
 
L

Linda

No, I couldn't get it to concatenate, because I don't know what expression to
use. I just meant that whatever was written for section could be duplicated
for township and range, which are separate fields.

Linda
 
D

Duane Hookom

Did you import the module into your application so you can use the function?
It would help to see some different RECIDs or whatever as well as the data
types. Your query might look something like:

SELECT RECID, [Name], Township, Range,
Concatenate("Select [Section] From YourTableOrQuery Where RECID = " & RECID)
as Sections
FROM YourTableOrQuery;
 
Top