Using Custom Module to adjust field visibility in the Deals section

Using Custom Module to adjust field visibility in the Deals section

In my deals section, I have a look up module that links to a custom module.  I would like to use the settings in the selected custom module record to alter the visibility of certain fields of the deal.

For instance,

Deal
Field A
Field B                                                                  Custom Module
Field C  -----custom module lookup------->       Field A' ----> if selected, field A is visible if unselected, Field A is hidden
                                                                           Field B' ----> if selected, field B is visible if unselected, Field A is hidden

Anyone with any thoughts on how to do this?