Selasa, 31 Juli 2012

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@yahoo.com
> 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
>
>
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar