Error on Form based on query with DCount

A

Amy Blankenship

I am using the following query as the data source for a form

SELECT Page.PageID, Page.ParentID, Page.QuestionID AS Page_QuestionID,
Page.PageOrder, Question.QuestionID AS Question_QuestionID,
Question.QuestionTypeID, Question.DistCorrect, Question.SubCatMajor,
Question.SubCatMinor, Question.QtypeID, Question.Difficulty,
DCount("*","frmDCountLineNums","PageOrder<=" & [Page].[Pageorder] & " AND
ParentID = " & [Page].[ParentID] & " AND SubCatMajor >0") AS QuestionNum,
getDistractorCodes([question].[QuestionID]) AS DistractorCodes,
Page.ParentLevelID
FROM Question RIGHT JOIN Page ON Question.QuestionID = Page.QuestionID;

Essentially, there are pages that aren't of interest to the "line number"
that the form needs to display on the screen, so I am using DCount of the
query frmDCountLineNums instead of PageOrder to allow the user to see which
page (with an actual scored question on it) is considered Question 1,
Question 2, etc. When I run the query by itself, everything works
perfectly. When I launch the form based on the query, every QuestionNum
contains #Error, rather than the expected question number.

Does any one know why this would be or how I can get at the actual error
that is occurring for troubleshooting?

TIA;

Amy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top