|
|
Print field from different table
Access 2007 on WinXP
I have a report designed that is printing the department number, I would
like to print teh department name instead. The depatment number is included
in teh query the report is based upon. The report requires data from 4
differnt tables and when I try to add a fift table into the report
relationship the output data duplicates unreliably.
I work primarily with the click and drag method of report build in design
view as opposed to coding everything. What I want is to print the DeptName
filed from the TblDept table where the tblDeptID in TblDept is equal to the
EmpDept field in the query. Below is my best atteplt at coding this in source
line of the report field
[Select DeptName from tblDept where DeptID=tblParticipantTrx].EmpDept
This resulted in a dialog box requesting data for Select DeptName from
tblDept where DeptID=tblParticipantTrx. I did not include teh square brackets
when en tering the statement above, Access placed those.
#1 is what I need to do possible, if so waht are my options?
Thanks for the effort
|
|
0
|
|
|
|
Reply
|
Utf
|
1/13/2010 3:46:03 PM |
|
Unless the tblDept has duplicate departments adding it to the existing query
with a join to EmpDept should not cause additional records.
You can use a subquery or the DLookup function.
(SELECT First(DeptName) FROM tblDept WHERE tblDept.DeptID =
[tblParticpantTrx].EmpDept) as DeptName
OR using DLookup function:
(DeptID is a number field)
DLookup("DeptName","tblDept","DeptID=" & [EmpDept])
(DeptID is a text field)
DLookup("DeptName","tblDept","DeptID=""" & [EmpDept] & """") as DeptName
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
JR Hester wrote:
> Access 2007 on WinXP
>
> I have a report designed that is printing the department number, I would
> like to print teh department name instead. The depatment number is included
> in teh query the report is based upon. The report requires data from 4
> differnt tables and when I try to add a fift table into the report
> relationship the output data duplicates unreliably.
>
> I work primarily with the click and drag method of report build in design
> view as opposed to coding everything. What I want is to print the DeptName
> filed from the TblDept table where the tblDeptID in TblDept is equal to the
> EmpDept field in the query. Below is my best atteplt at coding this in source
> line of the report field
>
> [Select DeptName from tblDept where DeptID=tblParticipantTrx].EmpDept
>
> This resulted in a dialog box requesting data for Select DeptName from
> tblDept where DeptID=tblParticipantTrx. I did not include teh square brackets
> when en tering the statement above, Access placed those.
>
> #1 is what I need to do possible, if so waht are my options?
>
> Thanks for the effort
|
|
0
|
|
|
|
Reply
|
John
|
1/13/2010 6:26:26 PM
|
|
The fifth table should have a primary key of the department number so you can
join it to the existing Department number in your query. This fifth table
should have the department name in it so it can be included in the report.
--
Duane Hookom
Microsoft Access MVP
"JR Hester" wrote:
> Access 2007 on WinXP
>
> I have a report designed that is printing the department number, I would
> like to print teh department name instead. The depatment number is included
> in teh query the report is based upon. The report requires data from 4
> differnt tables and when I try to add a fift table into the report
> relationship the output data duplicates unreliably.
>
> I work primarily with the click and drag method of report build in design
> view as opposed to coding everything. What I want is to print the DeptName
> filed from the TblDept table where the tblDeptID in TblDept is equal to the
> EmpDept field in the query. Below is my best atteplt at coding this in source
> line of the report field
>
> [Select DeptName from tblDept where DeptID=tblParticipantTrx].EmpDept
>
> This resulted in a dialog box requesting data for Select DeptName from
> tblDept where DeptID=tblParticipantTrx. I did not include teh square brackets
> when en tering the statement above, Access placed those.
>
> #1 is what I need to do possible, if so waht are my options?
>
> Thanks for the effort
|
|
0
|
|
|
|
Reply
|
Utf
|
1/13/2010 6:38:01 PM
|
|
|
2 Replies
199 Views
(page loaded in 0.042 seconds)
Similiar Articles: add field to form from different table - microsoft.public.access ...I have a form - record source is t0103Issue.(see below for fields) I would like to add a text box with a field (LevelorAdj) from a different table(se... Calculate field with input from different table - microsoft.public ...Unfortunately, Access 2007 only offers me all the fields within table A for incorporation in my formula. How can I use a field from a different table for a calculated ... Suppress printing group footer using Calculated field(s ...I want to compare the PART table QTY_ON_HAND to the field =Sum([QTY]-[COSTED_QTY]) and if they are different print the info and then check the UNIT_$ against each ... How can I sum several different fields in an Access report ...A table ... source of a form or ... How can I sum several different fields in ... QTY]) and if they are different ... public.access ... Conditional Printing of Certain Fields in ... How to print Design View of Table ? (Fields & Field ...Is there any way to print the design view of a table... meaning the list of field names, data types, and field descriptions Other than doing a scree... Form Field won't update two different tables - microsoft ...MS ACCESS :: Update Two Different Tables (fields) From One Text Box Update Two Different Tables (fields) From One Text Box Hi All, How do update two different tables ... Listing all Field names of each Table in db - microsoft.public ...... find a sequence of paths without loop, and having at least one different ... Print a list of table Field names - Access World Forums Print a list of table Field names ... Display table name as field in query - microsoft.public.access ...Does anyone know if there is a way to display the table name as a field in a query? I have a UNION query that merges all of the records from 10 different tables, but ... change color based on different criteria - microsoft.public.access ...... would print out any changes made after a certain date to print the changes in a different ... You still haven't provided any information about tables and fields. You would ... Access 2000 - Adding a new field to a form - microsoft.public ...I created a form from two different tables, but neglected to include two fields that are necessary. Thus, those two fields are not in the fields li... Excel Pivot Table – Printing Every Value in the Page Field Using ...Raj asks: I have an Excel pivot table set up with 150 different values in the page field. How can I run a macro to print each individual page? Using a Query to Combine Fields From Different Tables - NeoWikiUsing a Query to Combine Fields From Different Tables ... If you have not done so already, you can drag a field from one Table or Query to ... Microsoft Access - Tables - ULearnOffice - Learn Microsoft Office ...For example, the field of the table Charges can be ... Each is for a different occasion. You can ... Select one or several tables the structure of that you want to print. Compare Microsoft Access Records in Tables and Queries for Data ...For modified records, the different fields are identified. Results are shown in forms for you to view, export to a table in your database, or print. Excel Pivot Table Tutorial -- PrintingPrint Pivot Chart for each Page Item. The following code will print the pivot chart once for each item in the page field (assumes there is one page field). 7/15/2012 2:24:55 AM
|
|
|
|
|
|
|
|
|