A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query help please



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2010, 07:20 PM posted to microsoft.public.access.queries
Afrosheen via AccessMonster.com
external usenet poster
 
Posts: 70
Default Query help please

I have two combo boxes. Location and Super1
The location box lets you select a location where a staff member is working
at.For example U3 B-days.

The Super1 box lets you select their supervisor who works U3 B-days. As it
stands right now it will work. The problem is that it will show all
Supervisors through out the whole place.

I found a way where I can select from the Location box where it will pull up
just the supervisors for that location in the Super1 box. That works so far
so good.

Now, where the problem comes in is when the staff member is a supervisor. For
example:
Staff member Joe's location is U3 B-days
Supervisor for Joe is Fred who is also associated with U3 B-days.
Fred's supervisor would be from Unit 3. Not Unit 3 B-Days

When I go and look at staff member Joe, he has no supervisor because he's the
only one that's displayed.

This is the sql code:
SELECT qrySupervisor2.tblMain.lname+', '+tblMain.fname AS Expr1,
qrySupervisor2.PersonnelID, qrySupervisor2.[Position#], qrySupervisor2.
StaffId
FROM qrySupervisor2
WHERE (((qrySupervisor2.Location)=[forms]![frmEmployee_tab].[combo126]))
GROUP BY qrySupervisor2.tblMain.lname+', '+tblMain.fname, qrySupervisor2.
PersonnelID, qrySupervisor2.[Position#], qrySupervisor2.StaffId, tblMain.
Lname
ORDER BY tblMain.Lname;

I think I need to add something to the WHERE statement where it will show all
supervisors for Unit 1, Unit 2, Unit 3, or Unit 4

This was written right in a query not through VBA.

If it is a little confusing your not alone. I hope I've kind of worked
through it.

Thanks for the help.

--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.