Solved

Combo boxwith a difference

Posted on 2011-03-24
2
364 Views
Last Modified: 2012-05-11
Hi all,

Grateful for assistance/advice.

I have a form with a combo box which selects from a list of data from a particular field in a table. The selected item is then saved in another table...so far so good.

However i would like the combo to show up only a selection of items from that list. In other words i dont want the combo box to show all the list of items for that particular field but only a section of them based perhaps additional data from another field. hence...


field1 - field2
bob - a
jill - a
tom - b
jack - a

I would like the combo box to show only the names of field 1
that has "a" as field 2

Thanks
0
Comment
Question by:PipMic
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 35206350
You can certainly filter your combo, but the question is HOW do you intend to do this - or rather, what event would you use to trigger the filter?

Do you want it to ALWAYS filter based on the "field 2" data, and if so, where does that filter come from?

Note that to filter a Combo, you simply use a standard SELECT query with a WHERE clause:

SELECT Field1 FROM MyTable WHERE Field2='a'

This will ALWAYS filter that combo for records with "a" in Field2.

0
 

Author Closing Comment

by:PipMic
ID: 35206530
In access the the Where condition in enclosed in brackets. Other than that ok. Took me a few minutes to realise.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question