This topic is locked
[SOLVED]

 How To Bring Up The Data From Maste Formr To Chlild Form

5/25/2013 12:38:47 PM
ASPRunnerPro General questions
F
fsyeung author

How about the script to bring some data from master form to child form like below informatiom. Thanks
master :masterID, logdate, staffno

child : childId,masterID, logdate, staffno

F
fsyeung author 5/29/2013

Dear Sergey,
Any reply for me. Thx.

Sergey Kornilov admin 5/29/2013

Unfortunately it's hard for me to understand this request.
Can you supply some screenshots that would explain how it supposed to work, when this code needs to be executed etc?

F
fsyeung author 5/30/2013

Dear Sergey,
The information was send to your support email. Thx

Sergey Kornilov admin 5/31/2013

To auto-fill jobdt and staffno field on the child table add page use 'Add page: Before process' event on the Events screen:

if CSmartStr(Session(strTableName & "_masterkey1"))<>"" then

set dal_TableName = dal.Table("Master Table Name")

set rstmp = dal_TableName.Query("MasterKey=" & Session(strTableName & "_masterkey1"),"")

Session("jobdt") = rstmp("jobdt")

Session("staffno") = rstmp("staffno")

rstmp.close

set rstmp=nothing

end if


where MasterKey is primary key field name in the master table.
Then use Session("jobdt") and Session("staffno") as default values for these fields on the 'Edit as' dialog on the Visual Editor screen for child table.

F
fsyeung author 6/30/2013



To auto-fill jobdt and staffno field on the child table add page use 'Add page: Before process' event on the Events screen:

if CSmartStr(Session(strTableName & "_masterkey1"))<>"" then

set dal_TableName = dal.Table("Master Table Name")

set rstmp = dal_TableName.Query("MasterKey=" & Session(strTableName & "_masterkey1"),"")

Session("jobdt") = rstmp("jobdt")

Session("staffno") = rstmp("staffno")

rstmp.close

set rstmp=nothing

end if


where MasterKey is primary key field name in the master table.
Then use Session("jobdt") and Session("staffno") as default values for these fields on the 'Edit as' dialog on the Visual Editor screen for child table.

A
adnankmk 7/2/2013





What does the "_masterkey1" field represents.