SELECT DISTINCTROW help

  • Thread starter Thread starter MsWatts
  • Start date Start date
M

MsWatts

Good Morning,

I am working on a Questionnaire Database. I'm currently trying to link
questions to specific subforms is this possible? If so, would someone please
help me with the code?

If I was using the code below is there a way I could choose specific
questions like 1-30? Or would I need to create a table for each set of
questions?

SELECT DISTINCTROW tblQuestions.* FROM tblQuestions ORDER BY
tblQuestions.QuestionID, tblQuestions.QstnLvl;

Thanks for the help
~Tammy
 
Tammy -

Yes, you can select record ranges:

SELECT DISTINCTROW tblQuestions.* FROM tblQuestions
WHERE tblQuestions.QuestionID between 1 and 30
ORDER BY tblQuestions.QuestionID, tblQuestions.QstnLvl;
 
Good Morning,

I am working on a Questionnaire Database. I'm currently trying to link
questions to specific subforms is this possible? If so, would someone please
help me with the code?

WHOA!!!!!

A separate *SUBFORM* for each question? That's really not generally a good
idea. A subform is a display tool; if you have variable data for each question
you would normally have one or more controls (textboxes, etc.) on a single
subform with varying contents, not a different form for each question.
If I was using the code below is there a way I could choose specific
questions like 1-30? Or would I need to create a table for each set of
questions?

SELECT DISTINCTROW tblQuestions.* FROM tblQuestions ORDER BY
tblQuestions.QuestionID, tblQuestions.QstnLvl;

Sure. Just put a criterion specifying which question or questions you want to
see.

You may want to look at Duane Hookom's excellent "At Your Survey" sample at
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At Your Survey 2000'

or at

Roger Carlson's Training Registration database:
http://www.rogersaccesslibrary.com/download3.asp?SampleName=TrainingRegistration.mdb
 
I think that's why the QstnLvl is there. You could set a value in the main
form for the QstnLvl and use the Link Master/Child properties to display
questions based on the level. If you can't use this field, you might need to
add another method for grouping similar questions.
 
Back
Top