Cannot add records in query

  • Thread starter Thread starter Arvin
  • Start date Start date
A

Arvin

Good day to everyone!

I have created a select query from these tables
tblLeaveHdg tblLeaveTrans
LVNo(Primary Key, Autonumber) LVNo(Long)
EMPID DateAppl

tblEmpl
EMPID(Primary Key)
Name

My query looks like this

SELECT tblLeaveHdg.LVNo, tblLeaveHdg.EMPID, tblEmpl.Name,
tblLeaveTrans.DateAppl
FROM (tblEmpl INNER JOIN tblLeaveHdg ON tblEmpl.EMPID =
tblLeaveHdg.EMPID) INNER JOIN tblLeaveTrans ON
tblLeaveHdg.LVNo = tblLeaveTrans.LVNo;

If enter a data in EMPID it will automatically show the
name. But if I try to enter a data in the DateAppl field,
an error in the status bar is shown.

"Cannot add record(s); join key of table 'tblLeaveTrans'
not in record set"

I have done this kind of query but so far only this one
seems to have an error.

What wrong did I do? Please help understand this. Thanks
in advance.

Arvin
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As the error says: you don't have the join column tblLeaveTrans.LVNo
in the SELECT clause (though it didn't name the column). Therefore,
put the column tblLeaveTrans.LVNo in the SELECT clause. You do not
have to have it visible in the data entry form. When you enter data
for DateAppl the LVNo will automatically be inserted into the proper
column.

LVNo is the PK of tblLeaveTrans which means it is Required. You can't
enter data into a joined query if all the table's required fields are
not present.

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQBguWoechKqOuFEgEQIJAQCgxwfmgB8tLnuiYwp4rMf/DoHMgr4AoMIr
oGiPbWnzTombpLq4wYvKc99u
=/ovM
-----END PGP SIGNATURE-----
 
Back
Top