validation problem in look up

Hi Freinds ,

As i am New to Axapta .I have few Queries Please Can u Guide any one.

I have three tables 1)EFTProfileId(ProfileId, ProcessorType(it is enum))

2)EFTDeviceProfileId(DeviceProfileId,ProcessorType(it is enum))

3)EFTTerminalId(TerminalId,ProfileRecId(RecId of table EFTProfileId),DeviceProfileRecId(RecId of EFTDeviceProfileId Table)

Now i have form with database as EFTTerminalId:::in that form ProfileRecId & DeviceProfileRecId as feilds.

after selecting profilerecid,the next feild must show only records same as processortype of previous record.

so i want lookup and validation methods.i write lookup in terminal table.later can u help me what to do