Combo box on MS Access form

I have a form based on a query, it is a basic Support Call logging form. I have a combo box on the form and I can select Engineers names within that combo box and change the data shown on the form. I have done this with a criteria in the select query ([Forms]![Call Log Listing]![engineer]).
I would like to be able to enter "ALL" in the combo box so as to show all records on the form regardless of Engineer.
Any ideas gratefully rcvd
Iain
iainmacleodAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
try this query, copy and paste


SELECT [Call Logging].*
FROM [Call Logging]
Where IIF([Forms]![Call Log Listing]![engineer]="All",[Allocated Engineer], [Call Logging].[Allocated Engineer] = [Forms]![Call Log Listing]![engineer])
0
 
Rey Obrero (Capricorn1)Commented:
see this link for instruction
How to add '(all)' to a combo box or a list box control in an Access 2000 application

http://support.microsoft.com/?kbid=210290
0
 
iainmacleodAuthor Commented:
Thanks for that, however I am struggling with it. I am using Access 2010??
Does that make a difference?
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Rey Obrero (Capricorn1)Commented:
No..

post the rowsource of your combo box..
0
 
iainmacleodAuthor Commented:
I must be missing something basic in this, my row source type is AddAllToList and my row source is a Table that contains a list of engineers names. I dont understand where to paste the AddAllToList function on the form....
0
 
Rey Obrero (Capricorn1)Commented:
use a query as the rowsource of the combo box
something like this

select engineernames from tableName

what is the name of the table and field names that has the engineer names?
0
 
iainmacleodAuthor Commented:
Ok got that working: SELECT Username from ENGINEERS
0
 
iainmacleodAuthor Commented:
Still not sure about the rest of it though. Where do i put the code that allows "ALL"??
0
 
Rey Obrero (Capricorn1)Commented:
to add <All> to the selection, you have to use a union query as described in the link posted above.

SELECT Username from ENGINEERS
Union
SELECT '<All>'  from ENGINEERS
0
 
iainmacleodAuthor Commented:
I am afraid I am still not getting it.
I now can select "ALL" in my combo box, but I do not get any records displayed, I change to an engineers name and I get his jobs.
Must be missing something or just being a little dim. Thanks for your help so far.
Iain
0
 
Rey Obrero (Capricorn1)Commented:
post the SQL statement of the query where you are using the combo box as filter..
0
 
iainmacleodAuthor Commented:
Sorry, i am not getting this:
I have a select query that my form that contains the combo box is based on:

SELECT [Call Logging].*, [Call Logging].[Allocated Engineer]
FROM [Call Logging]
WHERE ((([Call Logging].[Allocated Engineer]) Like [Forms]![Call Log Listing]![engineer]));

My row source of the combo box is:

SELECT Username from ENGINEERS
UNION SELECT 'All'  from ENGINEERS;

When I select an Engineer in the combo box my form displays all of that engineers bookings fine, When I select ALL in my combo box I would like to see all engineers bookings.

Thanks for your patience
Iain
0
 
iainmacleodAuthor Commented:
Many thanks for all of your help... That worked a treat.
Best regards
Iain
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.