Use chosen value from combobox in a question event
Last Post 05-02-2011 08:04 AM by Mark Buelsing. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Mark BuelsingUser is Offline
river guide
river guide
Posts:241
Avatar

--
05-02-2011 08:04 AM
    Hi. I must be missing something. I hope it is simple for someone else to understand.

    This involves getting the chosen value of a combobox

    I have a combobox and a textbox

    I created a Question Event that sets the value of the textbox by "return SQL response based on anothers question response." and I tied it to to any change in value of the combobox.


    The SQL is a Stored Procedure with one parameter which is referenced to the name of the combobox. The only value it expects as a parameter is an integer.  I pass the value like:


    EXEC MyStoredProcedure $(ComboBoxShortName)


    I have also tried like this:

    EXEC MyStoredProcedure ComboBoxShortName


    The question event fires as expected. However it returns no value from the Stored Procedure. But if I change the question event to insert a real value instead of the reference to the combobox, it works. Like this:

    EXEC MyStoredProcedure 25       

    This works, and I get a proper return value from my stored procedure.

    Now just to answer your next question, yes, I think I can prove the combobox is returning an integer when a choice is made. I set up a client-side event that grabs value of the combobox and copies it into a textbox named test

    $(Test)= $(ComboboxShortName)

    And when the combobox is changed by the user, the correct integer shows up in the textbox named "Test". In fact, if I change the Question Event to use the "Test" textbox as the parameter value, the question event returns a value as it should and the target textbox has it's value.

    This all proves the stored procedure works and the combobox QuestionOptionValue is an integer within the right range. What is not working is referencing the combobox directly in the question event. So what is the right way to reference the combobox?

    Again, I did it like this:

    EXEC MyStoredProcedure $(ComboBoxShortName)


    This might also be a timing issue. What do you think? Thanks for your time!


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi