Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 DDDW in one DW

Status
Not open for further replies.

ahmedhossni

Programmer
May 1, 2010
6
EG
i have one dw containing three dddw
main dw: d_emp
dddw1: dddw_sect
dddw2: dddw_dept
dddw3: dddw_part


how can i pass a value from dddw_sect to dddw_dept and dddw_part that they can be retrieved with their retrival arguments ... all inside one dw "d_emp"

Example:

dddw_sect: "Factory"

when factory selected it will pass factory to dddw_dept, so all dept will be retrieved as argument.


Thank you..
 
So when the user enters the factory id you want the department dddw to be populated?

Generally you would do this in an event posted from the itemchanged event on 'main_dw' which gets triggered when the factory field loses focus (or triggerd by an accepttext). To populate the department dddw you need to use getchild.

example
Code:
// this event posted from itemchanged on main_dw

childdatawindow ldwc
long ll_factory_id
ll_factory_id = main_dw.getitemnumber(row,'factory')
main_dw.getchild(ldwc,'department)
ldwc.settransobject(SQLCA)
ldwc.retrieve(factory_id)
Factory_id is the value just entered and validated by the itemchanged script. If there is a lot of data in department it may be better to have it retrieved when the window opens and then filter on factory_id instead.

You should check the return codes on the statements in the example as well.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top