i need a simple query which can insert column-name of a value from another table and auto-mailing!!

problem 1:
i got 2 tables (dpt and dpm)

dpt
***
ACTUAL LEV_ACHIEVED
------- ---------
5300 (**)

dpm
***
name T1 T2 T3 T4 T5
---- -- -- -- -- --
cost 5500 5400 5300 5200 5100

so i need to get da column-name from da table dpm by taking da value of dpt.actual and checking it with da row value

in da above case da value (T3).

problem2:

i am using win98 and oracle form 6 ,so when i click da mail botton in a report
i get an error-rep:4201 !!