Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2012
    Posts
    3

    Unanswered: Access search funtion for questionnaire database

    Hi,

    I have had to make a data base to store questionnaires for around 1000 records, i have created all the fields that will hold the answers all 33 of them! and have a form to easily input the data.

    What i am after is a way for a user to search by each question by the answer for example, if they wanted to find each person who answer 1-2(text) for question d1. Is there away of doing this? maybe having a combo box to select the field they want to search by and a text box to enter the result they want to search by?

    Thanks

    I am fairly new to Access pretty much did 2 months of it at college and got asked to make a database!
    Last edited by Hana21; 03-07-12 at 08:38. Reason: spelling

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yes providing its easy to understand how your data is stored. you'd probably want to write the SQL on the fly and then execute that SQL

    eg
    select my, column, list from mytable
    where question_ID = "D1" and answer = "1-2"
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2012
    Posts
    3
    Quote Originally Posted by healdem View Post
    yes providing its easy to understand how your data is stored. you'd probably want to write the SQL on the fly and then execute that SQL

    eg
    select my, column, list from mytable
    where question_ID = "D1" and answer = "1-2"
    Basically my fields have subject id, date, then each question so, d11,d12,d13,d21,d23... etc.. so there is a field for each question.

    im trying to make it so you can select a question and then search for a record that has a certain answer so if it was a number you could search for any people/records that answered say <5 on that question. im not sure hpow you would riight this tho?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so is the answer you are looking for

    a string eg,"1-2" or numeric
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Mar 2012
    Posts
    3
    sorry i am getting confused by the answer lol

    some of the answer for some of the fields are text and sum are numeric,

    theyre are 30 questions so what i am after is to be able to make a form that

    when you select they question and put in a answer you can search through and have access bring up all people that answered that question with that answer, hope that makes sense.... also if you could have the ability to search throught multiple fields and put in mulitple answers to search for that would be good.


    I dont quite understand how to use your answer sorry about this im very new to access really

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you manipulate data in Access using SQL
    SQL is a separate computer language thats is optimised for manipulating data

    when SELECTing data you limit the rows returned using a WHERE clause
    the type of column make a huge difference to the type of where clause you use

    if you want those rows where there is an answer for question d1 whose value is 1 or 2 then your WHERE clause is something like
    Code:
    where question_id = "D1" and response in (1,2)
    which is different if the response column is string and you were looking for "1-2"
    but like many languages there are lots of ways of saying the same thing
    Code:
    where question_id = "D1" and (response >= 1 and response<= 2)
    if the results could only be 1....5 then
    Code:
    where question_id = "D1" and response<= 2
    is valid


    as this is a questionnaire you may want to look at the implications of NULL which in DB terms means there is no valid value for this particular question NULL is not the same as zero, NULL means there is no answer and rows that are NULL will be excluded fromt he domain functions such as average.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •