Questionnaire problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fishlab
    New Member
    • Feb 2008
    • 6

    Questionnaire problems

    Hello

    I'm using visual basic 2005 and i'm really useless and completely stuck.

    i'm making a questionnaire with a track bar from 1-7 to collect reponses.

    I have three forms. The first form is to collect information about the people i.e. name, gender etc but i don't know how to record the data that people put in and present it back to them at then end?

    The second form is the actual questionnaire ......the problem is i have 15 questions to present but i don't know how to do it on one form....i tried doing one form for each question but it makes the program too slow, so i'm not sure how to get the questions to appear one at a time

    I also need to record the responses from the trackbar and give them a score at the end....but i don't know how to do that either

    Please help!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    It is better to store all the data and the questions in a database table .

    Retrive questions from database and display in form and also store the responses.

    Finally you can display all that using crystal report.

    Comment

    • fishlab
      New Member
      • Feb 2008
      • 6

      #3
      Originally posted by debasisdas
      It is better to store all the data and the questions in a database table .

      Retrive questions from database and display in form and also store the responses.

      Finally you can display all that using crystal report.
      Ok thanks, i've been spending the past few hours trying to figure this out. where do i find the database table.....is that just a module?

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by fishlab
        Ok thanks, i've been spending the past few hours trying to figure this out. where do i find the database table.....is that just a module?
        You need to decide first which database to use and then create tables as per your requirment .

        Comment

        • fishlab
          New Member
          • Feb 2008
          • 6

          #5
          I don't understand, so i..... just create a file in word with the questions from my questionnaire and then import it into visual basic?

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by fishlab
            I don't understand, so i..... just create a file in word with the questions from my questionnaire and then import it into visual basic?
            Word is not a database .ou need to use any database like Oracle ,Ms Access or Sql Server.

            Comment

            • fishlab
              New Member
              • Feb 2008
              • 6

              #7
              I can't use a database.....it don't know how to use them and it just seems to complex.

              I've done some messing around and i've come up with this so far.....

              My form consists of a continue button and all the questions from the questionnaire on the form and a track bar. I've set all questions to not visible except the first one.

              The way i want it to work is that respondents read questions they then respond using trackbar.....pr ess the continue button.....scor e is recorded.....th en q1 disappears and question 2 appears....the whole thing repeats again. That will continue until all questions are answered and then the score will be calculated and presented at the end.

              It's not much but so far my code consists of this:

              [CODE=vbnet]Imports VB = Microsoft.Visua lBasic 'install VB functions
              Public Class Frm_Questionnai re

              Private Sub But_Continue_Cl ick(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles But_Continue.Cl ick

              Dim total As Integer
              If Lbl_1.Visible = True Then
              TrkBar_Input.Va lue = total
              End If

              Me.Hide()
              Frm_Results.Sho w()
              End Sub[/CODE]

              I'm stuck with the code at this point. How do i get it to store the value for the trackbar and keep a culmulative total?

              I know i need to put lbl_1.visible = false and lbl_2.visible = true in order to get the next question to appear..... however everytime i try it keeps coming up with an error wherever i put it.

              Am i along the right track??? Or have i got it wrong again?
              Last edited by Killer42; Feb 8 '08, 03:48 AM. Reason: Changed tag from QUOTE= to CODE=vbnet

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                Originally posted by fishlab
                Am i along the right track??? Or have i got it wrong again?
                I again suggest you to use Database not hard coding on controls.

                Comment

                • fishlab
                  New Member
                  • Feb 2008
                  • 6

                  #9
                  I can't use database i haven't been tuaght database yet i have to do this using code only to practice.

                  Comment

                  • daniel aristidou
                    Contributor
                    • Aug 2007
                    • 494

                    #10
                    Originally posted by fishlab
                    I can't use database i haven't been tuaght database yet i have to do this using code only to practice.
                    Create an array for the questions and an array for the reponses

                    Comment

                    • fishlab
                      New Member
                      • Feb 2008
                      • 6

                      #11
                      Hi

                      I finally managed to do my questionnaire using an array, however i can't get the forms to go in the right order.

                      For example when i debug it starts straight at the questionnaire form (which is the second form ) instead of at the first form which has name, gender etc.

                      When i created it, the questionnaire form was the first form but i changed the name to form2 and changed the other two forms accordingly.... .but it has had no effect.

                      Comment

                      Working...