Problems with a Report

B

Byron720

I'm creating an invoice report. Everything looks fine until I want to add a
field Employee Name. What appears is the Employee ID (number) and not the
name of the employee. Please help on this
 
K

Ken Sheridan

The column to which the control in your report is bound is almost certainly a
foreign key referencing the primary key of an Employees table. Base the
report on a query in which the Employees table is joined to whatever the
report is currently based on and bind the control to the employee name column
from the Employees table.

The reason you are probably seeing the name in the table and any forms based
on it will be because the display control is a combo box which looks up the
name from the Employees table. The underlying value is the unseen numeric ID
number, however.

Ken Sheridan
Stafford, England
 
P

Pat Hartman \(MVP\)

Replace the report's recordsource with a query that joins the main table to
the employee table on employeeID. You can select the employee name from the
employee table. Change the employee name control to bind it to the name
rather than the ID. It is also a good idea to change the control's Name
property to avoid confusion since it most likely is the name of the ID
field.
 
K

Ken Sheridan

1. Create a query (or amend the existing one if the report's RecordSource is
already a query) which includes all the tables necessary for your report,
including the Employees table (or whatever its called) which contains the
employee names. Add the necessary columns (fields) from the tables in the
design grid, including the employee name column.

2. Open your report in design view and change the report's RecordSource
property to the name of the above query.

3. With the report still open in design view change the Name property of
the control which is currently showing the ID number to something like
txtEmployeeName, and change its ControlSource property to the name of the
employee name column from the Employees table.

Ken Sheridan
Stafford, England
 
I

i_takeuti

Byron720 said:
I'm creating an invoice report. Everything looks fine until I want to add
a
field Employee Name. What appears is the Employee ID (number) and not the
name of the employee. Please help on this
 
Top