What is the exact error you're getting? Can you share a screenshot?
Another thought: typically I would recommend using table joins to connect different tables from the same Salesforce account. Check out the Knowledge Base article Deciding Between Joining Tables and Blending Data for more information that will help you decide which method is best for your situation.
You might also want to check out the Joining Tables entry in the Product Help guide.
I hope this helps!