Search Query with Subform - Edit records in related table

thmsjlmnt3953

Registered User.
Local time
Today, 21:01
Joined
May 20, 2014
Messages
120
Hi,

I have a query which looks for like * surname*

in tblemployee fname lname dept active

this works fine and i can search using a requery button

however as deptartments are stored in tbldepts

when i change the query to retrieve the dept name instead of number directly from the table and i try to change this on the datasheet subform it changes it in tbldepts instead?

how can i change what dept the employee is in (as in change the number in tblemployee - but display the actual name?)
 
Your tables are constructed incorrectly.

tblDepts is an independent table, related to a specific employee in the tblEmployees table, i.e.

tblEmployees.FKDepartments = tblDepartments.PKDepartments

tblEmployees
PKEmployee
fname
lname
active
FKDepartments

tbDepts
PKDepartments
dept

Always have primary keys in every table, always. PK is a primary key prefix, FK is a key prefix related to primary key; each is a long integer data type.
 

Users who are viewing this thread

Back
Top Bottom