jbarr
jbarr

Reputation: 3

MS Access Table>Query>Form Design Issue

I have two tables, a query, and a form and I can't get it to behave like I want. There is a relationship between Table 1 and Table 2 formed between Employee ID (Table 1) and Employee (Table 2)

Employees (Table 1)

Attendance (Table 2)

Employee Query

Attendance Form (This form is used to enter records into Table 2)

Essentially what I want is for the form to work like so:

The issue that I'm having is that the form wants to display the Employee ID rather than the name. This isn't practical for data entry but I still want the form to send the Employee ID to the table so we can run queries and reports.

Upvotes: 0

Views: 45

Answers (1)

June7
June7

Reputation: 21370

Advise not to use spaces in naming convention.

Set combobox properties like:

ControlSource: Employee
ColumnCount: 2
ColumnWidths: 0";1"
BoundColumn: 1
RowSource: SELECT EmployeeID, EmployeeName AS FullName FROM Employees ORDER BY EmployeeName WHERE Status = 'Active';

This will display name but save id.

Employee name parts really should be in separate fields: FirstName, MiddleName, LastName. Then RowSource like:
SELECT EmployeeID, LastName & ", " & FirstName & " " & MiddleName AS FullName FROM Employees WHERE Status='Active';

Upvotes: 1

Related Questions