Hi Arik, I have managed to solve the problem. I don't actually understand why, but it is now solved. I am going to explain how I fixed the problem and I hope you or someone else can understand why.
I am using three tables each one contains this information
And I changed the previous query to this
SELECT t1.Location, t1.ID, t2.quantity, t1.Name
FROM tblitem t1 JOIN tblorderitem t2 ON (t1.id = t2.itemid)
WHERE (t2.OrderID = #Order_id)
ORDER BY t1.Location
I think that I had redundant information adding tblOrder which is filtered by OrderID, when that field is already in tblOrderItem. I don't think this matters, because I can match as many tables as I want to make a bigger query. Anyway, If you know the answer, please let me know.