Referencing a field from another tab in a window

I have a window with 2 tabs (tabfirst, tabsecond)

tabfirst has a couple of fields all referencing one table in the database (tableone).
tabsecond same thing, and referneces 2 tables (tableone and tabletwo)

I'm trying to make it such that when user is on tabfirst and changes the value from a drop down window (child datawindow) then 2 drop down windows from tabsecond are reset.

I don't know how to reference tabsecond while i'm in tabfirst.

typically if all 3 dddw were in one tab it would be in itemchanged() and i could just use a choose case to reset drop down datawindows for the 2 fields depending if 1st field is modified.

but i have those 2 fields in another tab. so how do i reference those fields while itemchanged() in tabfirst?


badtz7229Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mj_norwichCommented:
If you have have on a window Tab control 'tab_1' with two tabs 'tabpage_1' and 'tabpage_2' you can simply reference from the dw_1 on the first tabpage_1(itemchanged event) second dw_2 on tabpage_2 as:
tab_1.tabpage_2.dw_2

Example:
/*** ItemChanged Event ***/
string                    ls_data
long                       ll_row, ll_rows
datawindowchild  ldwc_yourcolumn2

/* First tabpage/DW */
MessageBox('ItemChanged', 'tab_1.tabpage_1.dw_1.row = ' + String(row) + '/data = ' + data)

/* Get child on the second tabpage/DW */
tab_1.tabpage_2.dw_2.GetChild('yourcolumn2', ldwc_yourcolumn2)
ll_rows = ldwc_yourcolumn2.RowCount()
ll_row = ldwc_yourcolumn2.Find("yourcolumn2= '" + data + "'", 1, ll_rows)

MessageBox('tab_1.tabpage_1.dw_1.ItemChanged', 'tab_1.tabpage_2.dw_2.row = ' + String(ll_row))

ldwc_yourcolumn2.SetRow(ll_row)
ldwc_yourcolumn2.ScrollToRow(ll_row)
tab_1.tabpage_2.dw_2.SetItem(tab_1.tabpage_2.dw_2.GetRow(), 'yourcolumn2', data)


0
badtz7229Author Commented:
Hi, I would like it so that when the first dddw in tab1 is modified or selected then the other 2 dddw in tab2 appear blank on the window for the user and the user will only see the corresponding values when he/she clicks drop down arrow.
 
i have the following in tab1 itemchanged()

CHOOSE CASE GetColumnName()
            
      CASE "div_id"
            
      ll_divid = long(data)
      idwc_sub.retrieve ( ll_divid )
      idwc_resp.reset()

      tab1.tabpage3.dw_3.object.subid[row]       = 0
      tab1.tabpage3.dw_3.object.respid[row]       = 0

END CHOOSE

unfortunately, this is making those 2 dddw in tab3 appear 0 to user. when i tried
string isnull
setnull(isnull)

tab1.tabpage3.dw_3.object.subid[row]       = isnull
tab1.tabpage3.dw_3.object.respid[row] = isnull

I get the following error msg:
"Type mismatch accessing external object property subid at line 10  in itemchanged event of object dw_1 of w_test"

The dataype of divid, subid, and respid are numbers.
i've done this before setting dddw to null. don't understand why this is happening ?
0
mj_norwichCommented:
You are saying that fields *id are numbers but variable isnull is a STRING.

Instead of:
tab1.tabpage3.dw_3.object.subid[row]       = 0
or
tab1.tabpage3.dw_3.object.subid[row]       = isnull
try
tab1.tabpage3.dw_3.InsertRow(0)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
badtz7229Author Commented:
I realized that. that was exactly my problem. so i just changed
string isnull
setnull(isnull)
to
long isnull
setnull(isnull)

and that worked.
thx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.