Needs help with lookup list based on the value of another lookup field

Needs help with lookup list based on the value of another lookup field

I have a lookup field from “Module A” to a record in “Module B”.

I created “Module C” which have a lookup field to a record in “Module A” and a lookup field to a record in “Module B”. Within a record in “Mdule C”, If I selected a value in lookup field to “Module A”, then a list of record which associated with “Module A” from “Module B” should populate when I start looking up value in the lookup field to re ord in “Module B”.

This is very similar with the look up relationship between Contacts, Accounts and Potentials Modules. When I lookup a record of Accounts in Potentials, a list of Contacts associated with Accounts will pop up for selection when I decided to associate a contact to the Potentials.

Please help and show me how to do that for the custom modules. Greatly appreciate it!