Keith Nichols
Registered User.
- Local time
- Today, 07:21
- Joined
- Jan 27, 2006
- Messages
- 431
Can I use SQL to populate a text box in a report?
The source table has 1 field for employees assigned to projects, and I want the report to show employees for each project broken
down into the sections they work in. The desired result would look something like this:
Project XXXXXX
.....EDT/1..........EDT/2...........EDT/3...........PE
.....EDT/11........EDT/202........EDT/35........EDM/42
.......................EDT/25.........EDT/37
.......................EDT/260
.......................EDT/28
I have a working version of this using 4 separate subreports & associated queries but it seems clumsy to me and it is difficult to work
with the individual subreports due to their small size. I did manage to get the desired data results from a form in pivot table view
inserted into the report but could not control the formatting satisfactorily.
I have not been able to create a query that filters the employees by department into separate fields which could be the source for a
subreport.
So, after messing with this for a couple of weeks, I was wondering about using SQL in the report VBA to directly populate four text
boxes thus removing the 8 items from the database object browser. A quick attempt got me nowhere fast yesterday, and before I
dedicate hours to this pursuit, I'd first like to know it can be done, or take suggestions for a more sensible approach if there is one.
The details are:
tblProjectPersonnel
ProjectID
Identifier
Section
Many thanks in advance for any pointers or suggestions.
The source table has 1 field for employees assigned to projects, and I want the report to show employees for each project broken
down into the sections they work in. The desired result would look something like this:
Project XXXXXX
.....EDT/1..........EDT/2...........EDT/3...........PE
.....EDT/11........EDT/202........EDT/35........EDM/42
.......................EDT/25.........EDT/37
.......................EDT/260
.......................EDT/28
I have a working version of this using 4 separate subreports & associated queries but it seems clumsy to me and it is difficult to work
with the individual subreports due to their small size. I did manage to get the desired data results from a form in pivot table view
inserted into the report but could not control the formatting satisfactorily.
I have not been able to create a query that filters the employees by department into separate fields which could be the source for a
subreport.
So, after messing with this for a couple of weeks, I was wondering about using SQL in the report VBA to directly populate four text
boxes thus removing the 8 items from the database object browser. A quick attempt got me nowhere fast yesterday, and before I
dedicate hours to this pursuit, I'd first like to know it can be done, or take suggestions for a more sensible approach if there is one.
The details are:
tblProjectPersonnel
ProjectID
Identifier
Section
Many thanks in advance for any pointers or suggestions.
