Hello everyone,
At the moment I’m fighting with an update query in my database (I’m new to MS Access), I tried to search for helpful information everywhere but with no luck.
My DB description:
The goal of this database is to keep information about my projects. Every project has a list of assemblies and every assembly has list of components (lowest level). So I have 5 main tables (forms and subforms for lists as well):
ComponentsT->ComponentListT(list of components for assembly-as continuous form-it is shown as a subform on Assembly Main form)->AssembliesT->AssemblyListT (list of assembliess for project-as continuous form-it is shown as a subform on Project Main form)->ProjectsT. I also have table CLRSListT which I want to use for append and update query. The point of this is to have button on Project Main from to append all data (for project) into CLRSListT. But if I want to change something (quantity of components in the assembly), I would like to have an update button to update data in CLRSListT table. To make sure that always I have latest data.
Attached is copy of my DB.
My problem is as follows:
Append query works fine for me. All data are correct and stored in the CLRSListT. However, I struggle with update query, to update CLRSListT (with fields – CLRSListID=PK,ProjectID,AssemblyID,AssyListID,asslistQty,ComponentID and comlistQty).
Update query:
It does not update all data, and number of updated rows is incorrect. For example, I changed quantity of some components in one assembly (ComponentListT). When I run update query, data in my CLRSListT table are simply not reflecting information stored in ComponentListT. Please see image attached.
I appreciate any help in this matter as I don’t have any idea what I’m doing wrong :banghead:. Thank you very much in advance for any kind of help.
Regards,
Martin
At the moment I’m fighting with an update query in my database (I’m new to MS Access), I tried to search for helpful information everywhere but with no luck.
My DB description:
The goal of this database is to keep information about my projects. Every project has a list of assemblies and every assembly has list of components (lowest level). So I have 5 main tables (forms and subforms for lists as well):
ComponentsT->ComponentListT(list of components for assembly-as continuous form-it is shown as a subform on Assembly Main form)->AssembliesT->AssemblyListT (list of assembliess for project-as continuous form-it is shown as a subform on Project Main form)->ProjectsT. I also have table CLRSListT which I want to use for append and update query. The point of this is to have button on Project Main from to append all data (for project) into CLRSListT. But if I want to change something (quantity of components in the assembly), I would like to have an update button to update data in CLRSListT table. To make sure that always I have latest data.
Attached is copy of my DB.
My problem is as follows:
Append query works fine for me. All data are correct and stored in the CLRSListT. However, I struggle with update query, to update CLRSListT (with fields – CLRSListID=PK,ProjectID,AssemblyID,AssyListID,asslistQty,ComponentID and comlistQty).
Update query:
Code:
UPDATE ComponentListT INNER JOIN CLRSListT ON ComponentListT.ComponentID = CLRSListT.ComponentID SET CLRSListT.comlistQty = [ComponentListT]![comListQty];
I appreciate any help in this matter as I don’t have any idea what I’m doing wrong :banghead:. Thank you very much in advance for any kind of help.
Regards,
Martin