Linking fields in a survey

Posted on 2006-06-06
Last Modified: 2013-12-18
OK so I have one question in my survey where if the user selects 'Not Applicable' , the rest of the buttons should be emptied and if the users selects the answers to the questions then the 'Not Applicable' button be emptied.

My original survey is very, very basic, and the question on the survey is

How would you rate 2nd level teams? And then I have 3 fields - Courtesy, Knowledge,Responsiveness, and these field are radio buttons with the options Very Good, Good, Poor, Very Poor.  I have another field at the end which is my not applicable one but they are not linked in any way!  And now they want it linked, I need help!

Question by:Idltd
    LVL 22

    Expert Comment

    Hi Idltd,

    1. Check the "Refresh fields on keyword change" option in second tab of field's properties (to trigger postrecalc event when change occurs).
    2. In the form's PostRecalc event write the code that handles your thing.

    Hope this helps,
    LVL 22

    Accepted Solution

    something like this:

    Sub Postrecalc( Source As Notesuidocument )    
        If source.FieldGetText( "Courtesy" ) <> "" Then
            Call source.FieldSetText( "CourtesyNotApplicable", "" )
        End If

    End Sub

    But wouldn't it be the simpliest solution to add "Not applicable" as the last option in every field?

    Hope this helps,
    LVL 18

    Expert Comment

    Uh, why not use translation formulas in the fields themselves?

    something like:  @if(FirstField="NA";"";CurrentFieldName);

    Then for the first field:
      @if(thisField = "NA";@Do(

    Rough, but you get the idea.  People always forget to wipe a field when the check is unmarked, so the value stays on the form when it shouldn't.  Same thing for when a value unhides another field.  Use translation formulas to wipe the field value when the field is hidden and inactive.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now