Hi all,
Ive got a query that deletes a table entry in tblMachineParts. On the form frmDetailsChangeParts i have a subform called fsubDetailsChangeParts which contains a listbox called List6 which contains the contents of tblMachineParts.
This is my query SQL Syntax:
DELETE *
FROM tblMachineParts
WHERE MachinePartsID=Forms!fsubDetailsChangeParts.list6;
Then i have a macro assigned to a command button (on click event) on fsubDetailsChangeParts, so when a user selects a table entry from list6 then clicks the command button the record is deleted. However this is where my problem arises. When i run the main form (frmDetailsChangeParts), then in the subform select an entry from the listbox and click the command button, i get the Enter Parameter Value Box and the query wont run any further, i dont know why because i have the Forms!fsubDetailsChangeParts.list6; correct.
However when i run the subform fsubDetailsChangeParts on its own and select an entry from the listbox then click on the command button it runs the query fine and my table entry is deleted. I dont understand why when i run the main form (which is what the user will run) the query wont run, but when i run the subform the query runs and my table entry is deleted.
Any help with this 1 guys?
Thanks
Jim
Ive got a query that deletes a table entry in tblMachineParts. On the form frmDetailsChangeParts i have a subform called fsubDetailsChangeParts which contains a listbox called List6 which contains the contents of tblMachineParts.
This is my query SQL Syntax:
DELETE *
FROM tblMachineParts
WHERE MachinePartsID=Forms!fsubDetailsChangeParts.list6;
Then i have a macro assigned to a command button (on click event) on fsubDetailsChangeParts, so when a user selects a table entry from list6 then clicks the command button the record is deleted. However this is where my problem arises. When i run the main form (frmDetailsChangeParts), then in the subform select an entry from the listbox and click the command button, i get the Enter Parameter Value Box and the query wont run any further, i dont know why because i have the Forms!fsubDetailsChangeParts.list6; correct.
However when i run the subform fsubDetailsChangeParts on its own and select an entry from the listbox then click on the command button it runs the query fine and my table entry is deleted. I dont understand why when i run the main form (which is what the user will run) the query wont run, but when i run the subform the query runs and my table entry is deleted.
Any help with this 1 guys?
Thanks
Jim