I have a projects table and I manage the data input through a form. Along the way came the need for us to raise purchase orders against each project and keep a record of that too. As many purchases are associated with each project, I created an additional table (tblPO) to hold PO data and added a FK based on tblProjects PK (ProjectsID).
I created a query based on these two tables, added fields from tblPO and picked up FK ProjectID from tbl PO. I also selected couple of field from main projects table in order to show project name and location on the purchase order. It works well in the query and when I add details in PO related fields, I can see the FK is updated instantly. But when I linked the Purchase Order form based on this query to main projects forms using a command button, my efforts to create a record were not successful. I could see the Project ID field in the PO form was showing a zero and eventually I got an error message that MS Access engine cannot find a record in the table 'Projects with key matching field ProjectID. I tried both types of joins (inner and outer) and there is no luck.
Will appreciate if someone could help.
Regards
I created a query based on these two tables, added fields from tblPO and picked up FK ProjectID from tbl PO. I also selected couple of field from main projects table in order to show project name and location on the purchase order. It works well in the query and when I add details in PO related fields, I can see the FK is updated instantly. But when I linked the Purchase Order form based on this query to main projects forms using a command button, my efforts to create a record were not successful. I could see the Project ID field in the PO form was showing a zero and eventually I got an error message that MS Access engine cannot find a record in the table 'Projects with key matching field ProjectID. I tried both types of joins (inner and outer) and there is no luck.
Will appreciate if someone could help.
Regards