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!

datawindow

Status
Not open for further replies.

GUILLY

Programmer
Mar 23, 2020
3
US
Dear Sir/Madam,

I just wanted to seek help in creating a datawindow (dw_4) with the following requirements.

1) this datawindow consists of 3 columns ("acctno","name","age")
2) this table is intended to store a kids database (eg: how many kids do you have)
3) this datawindow is located in tabpage_3 (tabpage_3.dw_4)

scenario:

initially, this datawindow will display a single row. Now, if you have more than 1 kids and you are in the last column "age" when you hit [Enter] again a new row will be provided because of the dw_4.InsertRow(0) command. Let's say you have 2 or 3 kids and after encoding the details you are now ready to click the save button. Please take note that since these kids (2-3) belong to the same parent, the datawindow did not include the column "acctno".

Now the error upon clicking the save button was "accntno in table cannot be null". This is where I need help. couldn't figure out what approach to code the commands... Or if you have any simpler and easier suggestions on how to do it, I will really appreciate it.

Thank you.


kids_zi8lfh.jpg
 
please share how you solved it?

i think you just have to copied the value from parent datawindow and setitem it everytime insertrow occured
 
oppss... so sorry about that zulmach. too much excitement in writing code. Anyways, you are correct and that's what I did. To enumerate:

1) you have to GetItemString() on "account_no" from the tablepage_1 since this is where the information starts. It's up to you if you want to pass the value to a variable that will make the command shorter.
2) you need to SetItem() this "account_no to tablepage_3 where the encoding happens for the kid's information.
3) tab_3.tabpage_3.dw_4.SetItem(1,"account_no",tab_1.tabpage_1.dw_1.GetItemString(1,"account_no") this command should be on your save event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top