Jumat, 03 Agustus 2012

Re: [MS_AccessPros] A Query Problem

 

Dan

You've set up your table incorrectly. What you've done is create a spreadsheet which is highly denormalized. Every time there is a new accommodation you have to add a new field. You should have a table for accommodations available, not put them as fields in your table. There should be a table (let's call it tblStudTestAccom) with the Student ID, Test ID and Accommodation ID.

Create a table with 3 fields: AccomID AutoNumber, AccomCategory text, AccomDescr text

Fill the table with the accommodations, one per row. Put Math or Reading or whatever as the category. Now you can join this table to your tblStudTestAccom and you will be able to group on the category.

Making those changes will mean doing away with the check boxes on the form. It will require a subform with a combo box so the teacher can select the accommodation(s).

This might sound like a lot of work to redesign in this way, but it will end up being very versatile.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

--- In MS_Access_Professionals@yahoogroups.com, Dan Fielding <amessyguy@...> wrote:
>
> I have actually solved this little problem.  It doesn't resolve the reason it didn't originally work, but I'm happy with how it is working now.
>
> However, I do have another question...
>
> There is a Form where teachers will select all of the items they want to see on a report for the kids in their class.  On this Form there are check boxes related to different testing accommodations/adjustments a student can receive.  These are broken down by subject (Reading, Math, Science, etc.) since the accommodations allowed any student could vary depending on the subject.  An accommodation might be extra time to take a test, use of a dictionary or calculator, etc.  These are arranged in columns by subject.  Right now each individual accommodation is just a separate yes/no field that is named for human purposes with the subject and accommodation. For example, there is MathCalculator, MathExtraTime, ReadingExtraTime, ScienceDictionary, etc.
>
> Having arranged it this way, we discovered that we would like to be able to group the Report results by subject, but I don't think I built in any way to be able to do this.  I, a human, knows the field called MathCalculator is under the subject of Math, but Access doesn't.  I need to find a way to create grouping by subject and I cannot think of any way to do it on a Report based on a Query (which is based on which fields are selected on the Form).  Do you have any suggestions about this?
>
> Dan
>
>
>
> ________________________________
> From: Duane Hookom <duanehookom@...>
> To: Access Professionals Yahoo Group <ms_access_professionals@yahoogroups.com>
> Sent: Tuesday, July 31, 2012 12:07 PM
> Subject: RE: [MS_AccessPros] A Query Problem
>
>
> Dan,
> Feel free to share "some code that takes ..." and the SQL of "this Query to show the results".
>
> Most of us veterans build a WHERE CONDITION to use when opening forms and/or reports.
>
> Duane Hookom
> MS Access MVP
>
> ----------------------------------------
> > To: MS_Access_Professionals@yahoogroups.com
> > From: amessyguy@...
> > Date: Tue, 31 Jul 2012 09:02:36 -0700
> > Subject: [MS_AccessPros] A Query Problem
> >
> > I'm helping (a relative term) a friend with a problem passing more than one value to a Query.  We want to view student records either by Grade or by Teacher.
> >
> > I have some code that takes the selected grade from a ComboBox on a "selection Form" and passes it to the Query where the criteria for the GradeLevel field is Grade().  It works perfectly.
> >
> > I basically duplicated the Grade code, changing things where necessary, except this time for the teacher name.  It is on a separate "selection Form" that takes the name entered into a TextBox and passes it along to the Query where the criteria for the Teacher field is TName().
> >
> > There is a Form based on this Query to show the results.  It is supposed to open up having filtered records based on either of the selected criteria.  Everything works just fine--if I only have one criteria in my Query.  If I try to add the second criteria to the Query only the one in the left most position will actually work.
> >
> > As it is Grade comes before Teacher in the Query.  If I put the Grade() criteria in the first box (the AND box?) and the TName() criteria in the OR box below Teacher only the Grade comes through.  In order to get the TName() criteria to work I have to remove the Grade() criteria.  Can you help me so I can get both of the criteria to play well together--in the same Query.
> >
> > Hope this makes sense.  As always--thanks!!!
> >
> > Dan
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>                        
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar