Grouping report records via subheading

A

Ammo

I have created a report with the following headings that
contains the following sample data:

ProjectDetails ProjectOfficer ImplementingAgent

AS1/060 Arts proj Officer1 Company1
AS2/003 Sports proj Officer2 Company2
CS1/079 Comms proj Officer3 Company3
CS2/075 Young proj Officer4 Company4


On the report I wish it to be displayed as follows:

ProjectDetails ProjectOfficer ImplementingAgent

Arts Outcome
AS1/060 Arts proj Officer1 Company1

Sports Outcome
AS2/003 Sports proj Officer2 Company2

Communications Outcome
CS1/079 Comms proj Officer3 Company3

Young Peoples Outcome
CS2/075 Young Officer4 Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1 etc)
in the ProjectDetails field. Anyone one have any ideas how
this can be done?

Regards

Ammo
 
D

Duane Hookom

If I understand correctly I would create a tables
Code Description Sequence
AS1 Arts 1
AS2 Sports 2
CS1 Communications 3
CS2 Young Peoples 4

You can then add this table to your report's record source and set a
criteria like
WHERE Left(ProjectDetails,3) =
Code:
Add the fields to the grid so you can group and sort on the Sequence field.
 
A

Ammo

Hi Duane,

Thanks for your reply, but I am still having trouble with
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know what next
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) =
Code:
 under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do you know
what I am doing wrong, if so please can you help?

Cheers

Ammo

[QUOTE]
-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and sort on the Sequence field.
--
Duane Hookom
MS Access MVP


[QUOTE="Ammo"]
I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer   ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4


On the report I wish it to be displayed as follows:

ProjectDetails        ProjectOfficer   ImplementingAgent

Arts Outcome
AS1/060 Arts proj     Officer1         Company1

Sports Outcome
AS2/003 Sports proj   Officer2         Company2

Communications Outcome
CS1/079 Comms proj    Officer3         Company3

Young Peoples Outcome
CS2/075 Young    Officer4         Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1 etc)
in the ProjectDetails field. Anyone one have any ideas how
this can be done?

Regards

Ammo[/QUOTE]


.
[/QUOTE]
 
D

Duane Hookom

Good job on creating a table. That was the start.
You then should have created a new, calculated column in the query with the
expression:
Left(ProjectDetails,3)
and then set its criteria to
Code:
--
Duane Hookom
MS Access MVP
--


[QUOTE="Ammo"]
Hi Duane,

Thanks for your reply, but I am still having trouble with
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know what next
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) = [Code] under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do you know
what I am doing wrong, if so please can you help?

Cheers

Ammo

[QUOTE]
-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and sort on the Sequence field.
--
Duane Hookom
MS Access MVP


[QUOTE="Ammo"]
I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer   ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4


On the report I wish it to be displayed as follows:

ProjectDetails        ProjectOfficer   ImplementingAgent

Arts Outcome
AS1/060 Arts proj     Officer1         Company1

Sports Outcome
AS2/003 Sports proj   Officer2         Company2

Communications Outcome
CS1/079 Comms proj    Officer3         Company3

Young Peoples Outcome
CS2/075 Young    Officer4         Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1 etc)
in the ProjectDetails field. Anyone one have any ideas how
this can be done?

Regards

Ammo[/QUOTE]


.
[/QUOTE][/QUOTE]
 
D

Duane Hookom

Ammo replied:
"Still not working, the query produces blank results. When I add the
expression as a new column in the query, it automatically becomes:

Expr1: Left([ProjectDetails],3)

Do I need to do something with the relationships between the tables?"

Duane's reply:
You don't need to set relationships to the new table in the report's
recordsource. Add the criteria of
Code:
 under the column Expr1:
Left([ProjectDetails],3) should match each record in your report with one
record from tbl_OutcomeGroup. If you can't get this to work, then reply back
with the SQL view of your report's record source.

--
Duane Hookom
MS Access MVP
--

[QUOTE="Duane Hookom"]
Good job on creating a table. That was the start.
You then should have created a new, calculated column in the query with the
expression:
Left(ProjectDetails,3)
and then set its criteria to
[Code]

--
Duane Hookom
MS Access MVP
--


[QUOTE="Ammo"]
Hi Duane,

Thanks for your reply, but I am still having trouble with
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know what next
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) = [Code] under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do you know
what I am doing wrong, if so please can you help?

Cheers

Ammo

[QUOTE]
-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and sort on the Sequence field.
--
Duane Hookom
MS Access MVP


I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer   ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4


On the report I wish it to be displayed as follows:

ProjectDetails        ProjectOfficer   ImplementingAgent

Arts Outcome
AS1/060 Arts proj     Officer1         Company1

Sports Outcome
AS2/003 Sports proj   Officer2         Company2

Communications Outcome
CS1/079 Comms proj    Officer3         Company3

Young Peoples Outcome
CS2/075 Young    Officer4         Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1 etc)
in the ProjectDetails field. Anyone one have any ideas how
this can be done?

Regards

Ammo


.
[/QUOTE][/QUOTE]
[/QUOTE]
 
A

Ammo

Hi Duane,

The following is the SQL record source of the query:

SELECT tbl_ProjectDetails.ProjectDetails,
tbl_ProjectDetails.ProjectOfficer,
tbl_ProjectDetails.ProjectStatus,
tbl_ProjectDetails.ProjectManager,
tbl_ProjectDetails.ApprovalDate,
tbl_ProjectDetails.ImplementingAgent,
tbl_ProjectDetails.Address1, tbl_ProjectDetails.Address2,
tbl_ProjectDetails.ProjectDescription,
tbl_ProjectDetails.Address3, tbl_ProjectDetails.Address4,
tbl_ProjectDetails.PostCode, tbl_ProjectDetails.Telephone,
tbl_ProjectDetails.Fax, tbl_ProjectDetails.Email,
tbl_ProjectDetails.Contact, tbl_ProjectDetails.Salutation,
Left([ProjectDetails],3) AS Expr1
FROM tbl_ProjectDetails, tbl_OutcomeGroup
WHERE (((tbl_ProjectDetails.ProjectDetails) Is Not Null)
AND ((Left([ProjectDetails],3))=
Code:
))
ORDER BY tbl_ProjectDetails.ProjectDetails;


[QUOTE]
-----Original Message-----
Ammo replied:
"Still not working, the query produces blank results. When I add the
expression as a new column in the query, it automatically becomes:

Expr1: Left([ProjectDetails],3)

Do I need to do something with the relationships between the tables?"

Duane's reply:
You don't need to set relationships to the new table in the report's
recordsource. Add the criteria of [Code] under the column Expr1:
Left([ProjectDetails],3) should match each record in your report with one
record from tbl_OutcomeGroup. If you can't get this to work, then reply back
with the SQL view of your report's record source.

--
Duane Hookom
MS Access MVP
--

[QUOTE]
Good job on creating a table. That was the start.
You then should have created a new, calculated column[/QUOTE] in the query with
the[QUOTE]
expression:
Left(ProjectDetails,3)
and then set its criteria to
[Code]

--
Duane Hookom
MS Access MVP
--


[QUOTE]
Hi Duane,

Thanks for your reply, but I am still having trouble with
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know what next
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) = [Code] under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do you know
what I am doing wrong, if so please can you help?

Cheers

Ammo


-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record
source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and sort on
the Sequence field.
--
Duane Hookom
MS Access MVP


I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4


On the report I wish it to be displayed as follows:

ProjectDetails        ProjectOfficer ImplementingAgent

Arts Outcome
AS1/060 Arts proj     Officer1         Company1

Sports Outcome
AS2/003 Sports proj   Officer2         Company2

Communications Outcome
CS1/079 Comms proj    Officer3         Company3

Young Peoples Outcome
CS2/075 Young    Officer4         Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1
etc)
in the ProjectDetails field. Anyone one have any ideas
how
this can be done?

Regards

Ammo


.
[/QUOTE]
[/QUOTE]


.
[/QUOTE]
 
D

Duane Hookom

If you look at the first three characters of the ProjectDetails field, do
you see matching three character values in the Code field of
tbl_OutcomeGroup?

--
Duane Hookom
MS Access MVP
--

Ammo said:
Hi Duane,

The following is the SQL record source of the query:

SELECT tbl_ProjectDetails.ProjectDetails,
tbl_ProjectDetails.ProjectOfficer,
tbl_ProjectDetails.ProjectStatus,
tbl_ProjectDetails.ProjectManager,
tbl_ProjectDetails.ApprovalDate,
tbl_ProjectDetails.ImplementingAgent,
tbl_ProjectDetails.Address1, tbl_ProjectDetails.Address2,
tbl_ProjectDetails.ProjectDescription,
tbl_ProjectDetails.Address3, tbl_ProjectDetails.Address4,
tbl_ProjectDetails.PostCode, tbl_ProjectDetails.Telephone,
tbl_ProjectDetails.Fax, tbl_ProjectDetails.Email,
tbl_ProjectDetails.Contact, tbl_ProjectDetails.Salutation,
Left([ProjectDetails],3) AS Expr1
FROM tbl_ProjectDetails, tbl_OutcomeGroup
WHERE (((tbl_ProjectDetails.ProjectDetails) Is Not Null)
AND ((Left([ProjectDetails],3))=
Code:
))
ORDER BY tbl_ProjectDetails.ProjectDetails;


[QUOTE]
-----Original Message-----
Ammo replied:
"Still not working, the query produces blank results. When I add the
expression as a new column in the query, it automatically becomes:

Expr1: Left([ProjectDetails],3)

Do I need to do something with the relationships between the tables?"

Duane's reply:
You don't need to set relationships to the new table in the report's
recordsource. Add the criteria of [Code] under the column Expr1:
Left([ProjectDetails],3) should match each record in your report with one
record from tbl_OutcomeGroup. If you can't get this to work, then reply back
with the SQL view of your report's record source.

--
Duane Hookom
MS Access MVP
--

[QUOTE]
Good job on creating a table. That was the start.
You then should have created a new, calculated column[/QUOTE] in the query with
the[QUOTE]
expression:
Left(ProjectDetails,3)
and then set its criteria to
[Code]

--
Duane Hookom
MS Access MVP
--


Hi Duane,

Thanks for your reply, but I am still having trouble with
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know what next
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) = [Code] under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do you know
what I am doing wrong, if so please can you help?

Cheers

Ammo


-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record
source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and sort on
the Sequence field.
--
Duane Hookom
MS Access MVP


I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4


On the report I wish it to be displayed as follows:

ProjectDetails        ProjectOfficer ImplementingAgent

Arts Outcome
AS1/060 Arts proj     Officer1         Company1

Sports Outcome
AS2/003 Sports proj   Officer2         Company2

Communications Outcome
CS1/079 Comms proj    Officer3         Company3

Young Peoples Outcome
CS2/075 Young    Officer4         Company4


Any records with AS1 will come under a Arts sub heading
Any records with AS2 will come under Communications sub
heading.
etc

The report criteria will be set by the code (AS2, CS1
etc)
in the ProjectDetails field. Anyone one have any ideas
how
this can be done?

Regards

Ammo


.
[/QUOTE]


.
[/QUOTE][/QUOTE]
 
A

Ammo

Hi Duane,

Thankyou for your time and help, I have got the query to
display records after increasing the character left lookup
expression and adding the corresponding records in the
tbl_OutcomeGroup table. Hopefully will resolve this task
soon.

Best Wishes

Ammo
-----Original Message-----
If you look at the first three characters of the ProjectDetails field, do
you see matching three character values in the Code field of
tbl_OutcomeGroup?

--
Duane Hookom
MS Access MVP
--

Hi Duane,

The following is the SQL record source of the query:

SELECT tbl_ProjectDetails.ProjectDetails,
tbl_ProjectDetails.ProjectOfficer,
tbl_ProjectDetails.ProjectStatus,
tbl_ProjectDetails.ProjectManager,
tbl_ProjectDetails.ApprovalDate,
tbl_ProjectDetails.ImplementingAgent,
tbl_ProjectDetails.Address1, tbl_ProjectDetails.Address2,
tbl_ProjectDetails.ProjectDescription,
tbl_ProjectDetails.Address3, tbl_ProjectDetails.Address4,
tbl_ProjectDetails.PostCode, tbl_ProjectDetails.Telephone,
tbl_ProjectDetails.Fax, tbl_ProjectDetails.Email,
tbl_ProjectDetails.Contact, tbl_ProjectDetails.Salutation,
Left([ProjectDetails],3) AS Expr1
FROM tbl_ProjectDetails, tbl_OutcomeGroup
WHERE (((tbl_ProjectDetails.ProjectDetails) Is Not Null)
AND ((Left([ProjectDetails],3))=
Code:
))
ORDER BY tbl_ProjectDetails.ProjectDetails;


[QUOTE]
-----Original Message-----
Ammo replied:
"Still not working, the query produces blank results. When I add the
expression as a new column in the query, it[/QUOTE] automatically
becomes:[QUOTE]
Expr1: Left([ProjectDetails],3)

Do I need to do something with the relationships[/QUOTE] between
the tables?"[QUOTE]
Duane's reply:
You don't need to set relationships to the new table in the report's
recordsource. Add the criteria of [Code] under the[/QUOTE] column
Expr1:[QUOTE]
Left([ProjectDetails],3) should match each record in[/QUOTE] your
report with one[QUOTE]
record from tbl_OutcomeGroup. If you can't get this to work, then reply back
with the SQL view of your report's record source.

--
Duane Hookom
MS Access MVP
--

Good job on creating a table. That was the start.
You then should have created a new, calculated column in the query with
the
expression:
Left(ProjectDetails,3)
and then set its criteria to
[Code]

--
Duane Hookom
MS Access MVP
--


Hi Duane,

Thanks for your reply, but I am still having[/QUOTE] trouble
with[QUOTE]
implementing this problem. I created a table like you
recommended with the corresponding data. I then carried
out the following:

1)Opened the report in design view (the report is designed
from qry_ProjectDetails)
2)Selected report properties.
3)Clicked the 3 dots next to the ‘Record Source’ item.
4)Added the table that you told me to create (named this
tbl_OutcomeGroup)
5)I then added the fields from tbl_OutcomeGroup to the
qry_ProjectDetails.

After completing the above steps, I didn’t know[/QUOTE] what
next[QUOTE]
steps to take. I tried adding the expression, WHERE Left
(ProjectDetails,3) = [Code] under the ‘Sequence’ field in
the ‘Criteria’ section of the query, qry_ProjectDetail,
but kept receiving a message illegal operand, do[/QUOTE] you
know[QUOTE]
what I am doing wrong, if so please can you help?

Cheers

Ammo


-----Original Message-----
If I understand correctly I would create a tables
Code    Description          Sequence
AS1      Arts                     1
AS2      Sports                  2
CS1      Communications   3
CS2      Young Peoples     4

You can then add this table to your report's record
source and set a
criteria like
WHERE Left(ProjectDetails,3) = [Code]

Add the fields to the grid so you can group and[/QUOTE] sort
on[QUOTE]
the Sequence field.
--
Duane Hookom
MS Access MVP


I have created a report with the following headings that
contains the following sample data:

ProjectDetails        ProjectOfficer ImplementingAgent

AS1/060 Arts proj     Officer1         Company1
AS2/003 Sports proj   Officer2         Company2
CS1/079 Comms proj    Officer3         Company3
CS2/075 Young proj    Officer4         Company4
 
Top