My sugeston is to make two queries
First which (INSERT TYPE) wil add data from Allocation table Into stock Allocation table
It's view in Sql mode should be like this:
INSERT INTO [stock allocation] ( [qty allocated], material, [order number], [date], clear, [order detailid] )
SELECT...