Perry
Perry

Reputation: 1337

Access 2010 Cannot Add data in text box after upgrading to SQL Linked Tables

I have an Access Database that I converted to a SQL backend. Everything seems to be working fine except for one text box on my data entry form. When I try to enter data in the box I can click on the box to get the focus but no key strokes are excepted, When I press a key I get the windows error wav and I get an error message on the bottom left of the form that states: "Cannot add record(s): primary key for table StatusTbl not in recordset."

This is my query that is used as the forms Recordset:

SELECT SubjectTbl.*, PInformationTbl.*, tbl_employment.*, 
StatusTbl.LocationOfPlacement_C
FROM ((SubjectTbl LEFT JOIN PInformationTbl ON 
SubjectTbl.DJJNumber_O=PInformationTbl.[DJJID#])
LEFT JOIN tbl_employment ON SubjectTbl.DJJNumber_O=tbl_employment.emp_djjid) 
LEFT JOIN StatusTbl ON SubjectTbl.DJJNumber_O=StatusTbl.DJJNumber_C

This worked fine until I converted to SQL. Also all current records can be edited I just can't type anything in the textbox for new records.

Anyone have a fix for this?

Upvotes: 0

Views: 25

Answers (1)

Micktommyord
Micktommyord

Reputation: 61

From the look of your SQL you are only including StatusTbl.LocationOfPlacement_c, and not StatusTbl.ID (ID is whatever you Primary Key is) The error is telling you to include the ID for the Table in the Select call. This should allow the recordset to update/ insert with a valid structure and referential link.

Worth a try.

Upvotes: 2

Related Questions