jwhite
Software Developer
- Local time
- Today, 13:40
- Joined
- Sep 24, 2006
- Messages
- 141
With the code below, I am so close -- in the SUB Report's RecordSource, I am trying to refer to the value of IDNum on the MAIN Report to select the records out of tblProjectsAssigned where IDNum is the same, and pull all of the EmpID's that match the IDNum.
Below I believe I have copied all the information coded/related to the report. If I left out anything pertinent, please let me know. For now, I am at the crossroads looking 4 ways....
Below I believe I have copied all the information coded/related to the report. If I left out anything pertinent, please let me know. For now, I am at the crossroads looking 4 ways....
Code:
tblEmpList
- EmpID PK AutoNumber, -one _____
- EmpNameLast text \
- EmpNameFirst text |
... |
|
tblProjectsAssigned |
- paID PK AutoNumber -one |
- IDNum FK to tblProjects -many |
- EmpID FK to tblEmpList, -many _/
.
.
MAIN REPORT: rptProjectsDet
Record Source: tblProjects
Controls : txtIDNum, textbox, ControlSource = IDNum
...
.
SUB REPORT: rptProjectsDetSubA
Link Child Fields : IDNum
Link Master Fields: IDNum
.
Form RecordSource:
SELECT EmpID, EmpNameFirst & ' ' & EmpNameLast AS EmpName
FROM tblEmpList INNER JOIN tblProjectsAssigned ON tblEmpList.EmpID = tblProjectsAssigned.EmpID
WHERE (((tblProjectsAssigned.IDNum)= Me.rptProjectsDet.Report.txtIDNum));
.
Controls: txtEmpName, textbox, ControlSource = EmpName
.
Field List in Design Mode: EmpID, EmpName
.
.
In Main Report, the IDNum in the detail line prints okay.
When Sub Report is called, 'Me.txtIDNum' has no value and I have to enter a number (like a parameter query)
The dilemma is IDNum is not being passed to the sub report.