How to tell which field made a relate ?
Piotr asked: My next problem is: if there is some way to get the name of field in calculation. I mean, I 'd like to set comment legal in relational file depended on reference which field was called from. i.e.: main file has question: Which medicine have you used for last 12 month? And there is multiply response so I'd like to use relational file. But the next quetion is: Which medicine ...ever used? And my problem is to have ONE file with the medicine, and in this file I should have an information about respondent, and form WHICH FIELD was calling.
------------------------------------------------------------------ Something along this line where you combine a global variable with a comment legal depending on its value should work, some experimentation needed:
chk file:
before file * note the global define fieldname ____________ global end
id mustenter key unique end
v1 after entry fieldname = "v1" relate id otherfile 1 end end
v2 after entry fieldname = "v2" relate id otherfile end end
otherfile's chk file: before file * note you can repeat a define to be able to use the file alone define fieldname _________ global end
id key mustenter end
moreinfo before entry comment legal 10 "no answer" 11 otherfiled end if fieldname = "v1" then comment legal 1 yes 2 no end endif if fieldname = "v2" then comment legal 11 yes 12 no end endif end end
regards Jens Lauritsen Jens M. Lauritsen, Consultant,MD. PhD. The EpiData Association, (EpiData Foreningen) Enghavevej 34, DK5230 Odense M. Denmark e-mail: info@epidata.dk For E-mail news on EpiData: Http://www.epidata.dk/php/maillist.php EpiData is freeware
epidata-list@lists.umanitoba.ca wrote:
Something along this line where you combine a global variable with a comment legal depending on its value should work, some experimentation needed:
This is great idea, to keep the name of field. Thank You. But I don't realised that I can't open the related file twice. When I open file with first command "relate", the same file couldn't be opened in the next part of form. Am I right?
regards, Piotr
participants (1)
-
epidata-list@lists.umanitoba.ca