Access 2010 combo box

I've inherited a rudimentary database which many issues. One of the things that is bothering me is that I am working with a CURRENT STATUS combobox lookup comprised of First Names of some of the staff who work with clients plus the value "Closed". So when there are staffing changes, the Current Status table values have to be updated and currently do not link to the employee table. I would like to populate this lookup from the Employee table but how would I do that and also include the "Closed" value in the cbobox? This is not something I've had to do before
Joanne BaileyDatabase AdministratorAsked:
Who is Participating?
 
Fabrice LambertFabrice LambertCommented:
Hi,
try with the following query in the combo box's rowSource:
SELECT [First Names]
FROM tblEmployee
WHERE CurrentStatus = True
GROUP BY [First Names]
UNION
SELECT DISTINCT "Closed"
FROM tblEmployee

Open in new window

In fact, the table in the 2nd query doesn't matter since you arn't pulling data from it, but Access require it (duh !).
This is why the DISTINCT statement is required, to avoid duplicate results.
0
 
John TsioumprisSoftware & Systems EngineerCommented:
So the solution would be to link the Employee table to the Current Status and checkmodify the combobox accordingly...It would be most helpful if you share a sample of this database..
0
 
Joanne BaileyDatabase AdministratorAuthor Commented:
Hi John. I am trying to get away from having a separate Current Status table since I think the values should come from tblEmployee where CurrentStatus (Y/N) permission = True. I recall there is a way to do this using a union query but have not used union queries before. I can't attach the database (due to confidentiality agreeement) but I can tell you that I am simply trying to populate a combo box on a form which is bound to the CurrentStatus field in tblCase with First Names from tblEmployee where CurrentStatus is True and also offer the value "Closed" in the pick-list, Hope that makes sense.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeffrey CoachmanMIS LiasonCommented:
Then post a simplified example of the database with generic data, ...just to illustrate the issue..

Remember, without a full understanding of the design, ...we are limited to what we can propose as an "answer"

For example,
...it is no clear how a status of "closed" relates to the employee and the clients,...and under what conditions is it "Closed" or "Open"?
0
 
PatHartmanCommented:
It would appear that you have a design issue. You are using one field to hold two attributes Open/Closed and a person's name.  It would be better to fix the underlying problem and use two fields. Your status values, assuming they are pretty static, can be a value list.  Then the second combo can pick an employee.
0
 
Joanne BaileyDatabase AdministratorAuthor Commented:
Thank you Fabrice, that is exactly what I was looking for. Seems so simple now. Also understand and agree with Pat but "Current Status" is not an accurate label/field name. This field is used to show who is looking after the file now. And the client wants "Closed" to appear in the list. Thank you everyone for your assistance.
0
 
PatHartmanCommented:
Yes, you can add "Closed" to the list as Fabrice suggested but it prevents you from using RI.  It would be better to add "Closed" as an employee.  But using the field for two purposes is still WRONG and that is what should be fixed.
0
 
Fabrice LambertFabrice LambertCommented:
Solution accepted, but the original poster did not gave credits
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.