+ Reply to Thread
Results 1 to 4 of 4

Q&A Database

  1. #1
    Registered User
    Join Date
    10-16-2009
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    10

    Q&A Database

    I am looking for help creating a database that will perform the functions I described below, can you help me? I attached an Excel document that might give you a better idea of what I am trying to do in Access.

    I open up the database and frmBegin opens with one command button named Ask Questions.

    I click the command button named Ask Questions and a macro runs that selects a random question from tblQuestionsToAsk and displays it in frmAnswer. (tblQuestionsToAsk has two fields, Field 1 is titled QuestionID /datatype AutoNumber and Field 2 is titled Questions /datatype memo)

    frmAnswer has the following text boxes and labels
    - Question: text box that displays a random question from tblQuestionsToAsk (data type memo)
    - Answer: an empty text box where I can answer the question; the data type for this empty field is also memo. (I want to be able to put long answers into this field.)
    - Two command buttons below the empty text box that say
    * Stop
    * Continue

    Once the question is answered I can either click stop or continue on the message box.

    Each question has a table that holds its answers. So QuestionID #1 from tblQuestionsToAsk links to tblQ1. QuestionID#2 from tblQuestionsToAsk links to tblQ2. QuestionID#3 from tblQuestionsToAsk links to tblQ3. Each tblQ has two fields AnswerID datatype AutoNumber and Answers datatype Text. Each time I add a question to tblQuestionsToAsk a corresponding tblQ table is automatically generated to store the answers to those questions.

    On frmAnswer

    - If I click stop the answer I gave will be put into the appropriate tblQ.

    - If I click continue the answer I gave will be put into the appropriate tblQ and then a macro will select a new random question from tblQuestionsToAsk and the same process will be repeated.

    Can you help me create this database?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-16-2009
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Q&A Database

    I think my first post might have sounded confusing so I re-wrote it here. Hopefully my question is clearer now.

    I have a database with one table called tblQuestionstoask. This table contains two fields and 200 records (Each record contains one question and I intend on adding more records). The first field is Question ID / data type auto number the second field is Questions to ask / data type memo.

    I am looking for help creating a macro for this database that will.

    1) Open a form or message box (whichever works better) with a random record containing a question from tblQuestionstoask and a field to give an answer. After the user gives an answer and presses enter…..

    2) A new table will be created for that question and all the answers given for that question henceforth will go into that table. Once any question is asked more than once the answers will go into the table that has already been created for the question, no new tables will be created.

    Can you tell me how I can add these functions to my current database?

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Q&A Database

    Hi Teddy,

    Why do you need to have seperate tables for each answer? It would far be easier (and conform to the rules of normalization) to have a single table, "tblAnswer" that includes AnswerID, QuestionID, GivenAnswer etc.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Registered User
    Join Date
    10-16-2009
    Location
    Orlando, Florida
    MS-Off Ver
    Excel 2003
    Posts
    10

    Solved

    Post solved
    Last edited by Teddy; 12-19-2009 at 04:18 PM. Reason: SOLVED

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1