Page 7 of 7 FirstFirst 1234567
Results 91 to 101 of 101
  1. #91
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901

    In order to see the questions in the subform (and in the associated bound query), you have to populate AnswTbl with records. At present, there are no records in that table. On the frmRev is a button that must be clicked to run the append query to populate AnswTbl.

  2. #92
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74
    it does not populate when I click the button. That is what I am trying to figure out, why it is not populating.

  3. #93
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    This is what the append query looks like when I click on the button:

    INSERT INTO AnswTbl ( Reviewer, QuesNum ) SELECT 1, QuesTbl.[QuestionNumber] FROM QuesTbl WHERE QuestionNumber in (SELECT fkQuestionNumber from categoryQuestionsTbl WHERE fkCat_ID =5) ORDER by QuesTbl.[QuestionNumber]


    As you can see, the query depends on both the QuesTbl and the categoryQuestionsTbl. You have records in the QuesTbl but NO records in the categoryQuestionsTBL. You need to populate that table.

  4. #94
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74
    still not populating after populating the categoryQuestionTbl. When I click on the button nothing. ??????

  5. #95
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Are all field names identical to what they were before?

    Will this query run?

    INSERT INTO AnswTbl ( Reviewer, QuesNum ) SELECT 1, QuesTbl.[QuestionNumber] FROM QuesTbl WHERE QuestionNumber in (SELECT fkQuestionNumber from categoryQuestionsTbl WHERE fkCat_ID =5) ORDER by QuesTbl.[QuestionNumber]

    If all of that fails, can you post the database now with the categoryQuestionTbl populated?

  6. #96
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74

    I still couldn't get the query to work so here is my updated DB

    here is my attachment
    Attached Files Attached Files

  7. #97
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You have to have data in both the fkCat_ID and fkQuestionNumber fields in CategoryQuestionsTbl populated with data. As shown below, the fkQuestionNumber field has no data

    pkCatQuesID fkCat_ID fkQuestionNumber
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9

  8. #98
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74
    I am reading the correspondence from #31, on 08-14-2012, it says I will have to run a series of queries to get rid o fth questions in 1311-1411 range other than commercial. I will need a seperate query for commercial.

    I can't remember how I did this. If I remember right you populated them with the initial set of numbers and then I had to removes some numbers from the commercial category.

    Can you remember what you did in thread 29?

  9. #99
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The append queries will all look similar to the following. You will need to use the WHERE clause to adjust the question numbers (see red text) that get appended for each category. You will have to adjust the category value as well (see green text). In the following example, the questions with key values 1001 through 1015 will be appended to CateogryQuestionsTbl all with the categoryID set to 1.

    INSERT INTO CategoryQuestionsTbl ( fkQuestionNumber, fkCat_ID )
    SELECT QuesTbl.QuestionNumber, 1
    FROM QuesTbl
    WHERE (((QuesTbl.QuestionNumber) Between 1001 And 1015));

  10. #100
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74
    can I select between two ranges of numbers, example between 1001 and 1310; and between 1401 and 1411??? Is the syntax correct?

  11. #101
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    example between 1001 and 1310; AND between 1401 and 1411
    No, you cannot do that because a question number cannot be in both ranges simultaneously, but you should be able to use OR in place of AND

    INSERT INTO CategoryQuestionsTbl ( fkQuestionNumber, fkCat_ID )
    SELECT QuesTbl.QuestionNumber, 1
    FROM QuesTbl
    WHERE (QuesTbl.QuestionNumber Between 1001 And 1015) OR (questionnumber between 1401 and 1411)

Page 7 of 7 FirstFirst 1234567
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Append Query?
    By kwooten in forum Queries
    Replies: 27
    Last Post: 10-19-2011, 10:06 AM
  2. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  3. append query
    By gimmy in forum Queries
    Replies: 1
    Last Post: 09-09-2011, 10:41 AM
  4. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  5. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums