Prev: mouse over bolding for option labels on Switchboard
Next: MS Access 2003 Locks Up When Running mdb Developed In MS Access 20
From: MsWatts on 20 Apr 2010 11:55 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
From: Daryl S on 20 Apr 2010 12:07 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; -- Daryl S "MsWatts" wrote: > 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
From: John W. Vinson on 20 Apr 2010 13:08 On Tue, 20 Apr 2010 08:55:02 -0700, MsWatts <MsWatts(a)discussions.microsoft.com> wrote: >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%20Your%20Survey%202000' or at Roger Carlson's Training Registration database: http://www.rogersaccesslibrary.com/download3.asp?SampleName=TrainingRegistration.mdb -- John W. Vinson [MVP]
From: Duane Hookom on 20 Apr 2010 16:09
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. -- Duane Hookom Microsoft Access MVP "MsWatts" wrote: > 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 |