title: Filemaker Pro: Assigning a value to a field depending of the Tab
body: <p>It's a followup question about my project (designing a clinical trial form). My first question is here: <a href="https://stackoverflow.com/questions/10225004/filemaker-pro-create-multiple-entries-of-a-table-with-tab-control">Filemaker Pro: Create multiple entries of a table with Tab Control</a></p>
  
  <p>In order to simplify, I've created a test FMP file. Here is the design of the database and the layout.<br>
  <a href="http://img209.imageshack.us/img209/812/help2a.png" rel="nofollow noreferrer">Database structure</a><br>
  <a href="http://imageshack.us/photo/my-images/137/help1i.png/" rel="nofollow noreferrer">Layout of the example</a></p>
  
  <p>For each patient, I'm creating a record in Patient Table - Patient_ID is the identifier. I'm going to put some general informations (here I used only the name).
  On the other Table, labeled "Tableau_Data", I'm going to store some data - Data_ID is the identifier. The table Patient" and "Tableau_Data" are linked with Patient_ID.<p></p>
  
  <p>The data will always be composed of the same field (in my example: "Turlututu") - in reality more than 50 parameters. We're going to collect the data for 5 days (so I've 5 tabs). Thanks to the help of Sam Barnum, I'm able to have a different record of "Tableau_Data" in each Tab, by using portals.</p>
  
  <p>But I want to store in each record of "Tableau_Data" the tab it's coming from (field "Jour"). So I would like to have a way to set the automatically value of "Jour" depending of the tab: a script perhaps links to the portal or the field. But how ?</p>
  
  <p>Ideally I would like to hide the "Jour" field.</p>
  
  <p>By default, I can make a drop-down list and let the user set the value of this variable. I'd rather that. Not ergonomic and it could lead to error during the capture of the data.</p>
  
  <p>Sam Barnum hinted that perhaps I could pre-generated the 5 records of Tableau_Data link to my Patient_ID. So with that I would know that records 1, 6, 11, 16, ... are for Jour=1 and records 2, 7, 12, ... are for Jour=2 and so on. But I do not even know how to do that.</p>