Results 1 to 4 of 4
  1. #1

    Data driving Surveys with Radio Buttons

    So here is the scenario

    I have to data drive a 160 question survey. Each question is has a set of 6 radio button responses.

    The questions and answer sets are displayed 9 per page

    My initial plan was to edit the names of each of the answers (i.e. each radio button) to be A1, A2, A3, A4, A5 and A6. Then, when it came to feeding the data using my Excel spreadsheet, I could simply specify an answer by keying specifying, for example, A1.

    So I attempted to use this code
    <font class="small">Code:</font><hr /><pre>
    Dim Answers

    Set Answers=DDT.ExcelDriver("c:/Basic.xls","Answers")

    </pre><hr />

    Where "Answers.Value(0)" specified "A1" in the spreadsheet.

    However, at execution, TC advises that the object cannot be found.

    To test whether it was my data-driving technique at fault, I tried a simple test using the following code

    <font class="small">Code:</font><hr /><pre>
    Sub TestExcel
    Dim Answers
    Set Answers=DDT.ExcelDriver("c:/Basic.xls","Answers")
    End Sub
    </pre><hr />
    And this test successfully pulled the "A1" value out of the spreadsheet.

    Any ideas what I am doing wrong in the first section of code?

    I imagine there is something to do with the "Answers.Value(0)" argument not taking to being sandwhicheve between the "Q1." and the ".Click"

    Much appreciated

  2. #2

    Re: Data driving Surveys with Radio Buttons


    You get errors because the Aliases.Survey.Q1 object doesn't have a child named Answers. Your code is incorrect. You can use code like this:
    <font class="small">Code:</font><hr /><pre>...
    Call Eval("Aliases.Survey.Q1." &amp; Answers.Value(0)).Click()
    ...</pre><hr />
    Jared - AQA Support

  3. #3

    Re: Data driving Surveys with Radio Buttons

    Excellent, thanks Jared

    Is the Eval function the same as Evaluate? I could not find help on Eval.

  4. #4

    Re: Data driving Surveys with Radio Buttons


    You can find information on Eval here.
    Jared - AQA Support



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:41 PM.

Copyright BetaSoft Inc.