473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Filtering Contents of a Drop Down List Based on Another Field

This is causing my some grief :)

I have a form that displays records in a tabular format, one field is a combo box that displays values from another table. But I only want some of those values to be displayed based on another field on my form. So as I go to the next record I want the values in the combo box that I select to change.

I did a query based on the field value and then in the combo box entry event I did a requery and it worked great for restricting my fields but it hosed all the other records.

So lets say record 1 Area=1 I want values A,B,C and record 2 Area=2 I want values D,E,F. I go to record 1, click the combo box and A,B,C show up in my list I select "A"

Then when I went to record 2, click on the combo box, D,E,F show up fine but when I select D, the field in record 1 goes blank because its value is no longer in my list.

I think I'm almost there just missing one detail.
Mar 29 '10 #1

✓ answered by slenish

Ok I think I am starting to understand what you want to do.

check out this link and see if its what you are trying to do. If it is and you need more help let me know. If its not I will try to find another solution

http://www.databasedev.co.uk/filter_combo_boxes.html

7 51569
slenish
283 100+
Hi Simulation guy,

I think I have been messing with something very simular to what you are having problems with.

I can try to help you out if you give me a little more information. Remember im going to try. Im pretty new to this but your problem sounds almost exactly like mine was which took me a week to figure out.

If you can give me just a little more info I might be able to narrow it down. First how many combo boxes do you have? Are you trying to select A,B,C in one combo box and then in another combo box have something else pop up? So for example if I select A in combo1 then in combo2 Apple pops up? The information you are trying to have pop up is it already in just one table or is the information in many tables?

I'll do my best to help
Mar 29 '10 #2
I appreciate any help. Hopefully I can explain it okay.

There are two combo boxes (two fields in the same record) , one table. One field in the table is a location and the combo box lets you select that location from another table. The second field is an area and the combo box lets you select the area from another table. But based on the selection of the Location, I want to
limit what areas you can pick. The table with the areas also has a field for which locations they belong too.
I set up a query that worked select .... WHERE tblArea.LocationID=tblEquipment.LocationID and did a requery when I click on the combo box for the Areas. Everything worked except it wiped out that field for the previous records.

I think I need to somehow make my second combo box unbounded and transfer the selection to my field in the table. Right now its bounded to that field.
Mar 30 '10 #3
slenish
283 100+
Ok I think I am starting to understand what you want to do.

check out this link and see if its what you are trying to do. If it is and you need more help let me know. If its not I will try to find another solution

http://www.databasedev.co.uk/filter_combo_boxes.html
Mar 30 '10 #4
Thanks! That is exactly what I am trying to do
Mar 30 '10 #5
slenish
283 100+
Your welcome glad I could help out :D
Mar 30 '10 #6
Crap, it didn't quite work as expected. The combo box works great but the problem is when it filters the records in the combo box then it also makes the selection in the other records go blank. I think its close just missing some little trick.
Mar 31 '10 #7
Here is a link to a page that describes the approach for a multirecord form if you ever need it. Its a hack but it seems to work

http://www.blueclaw-db.com/download/..._combo_box.htm
Mar 31 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: CJM | last post by:
Not sure if this is entirely on-topic.... I would ideally like to present an initial list based on one DB table. The user selects an item, and the 2nd list is updated to show items from the DB...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
2
by: jagdishl | last post by:
hi I have to populate the second drop down list based on the selection made in the previous drop down list.I have to chose between two values in the first dropdown list i.e city and county.This is...
5
by: NickMc71 | last post by:
Hello, My page is dynamically generating a product listing for a drop down list based on our options. For example, one page might show this: <select name=stylekey> <option...
0
by: yosri2005 | last post by:
Hello, I'm sure many of you have seen the error message in the subject. I found quiet a few posts on the web regarding this issue, but the ones I saw mainly tackle this issue when you have a...
1
by: dcrewhouse | last post by:
Hello-- I have been working with the problem for a while and have yet to find a solution. Does anyone know how to populate a drop down list box based on the selection from another drop-down in a...
1
by: deerick | last post by:
Hi there I want to know how to add a drop down list based on value from a table in an asp form. Then I want the user to be able to submit the form, and the drop down list value that they have...
2
by: axapta | last post by:
Hi Group, How can I limit a second drop-down list box based on a selected value in the first drop down list box. Using vb.net Regards
14
by: mjvm | last post by:
HI, I have had a search for the answer to this question, but I can't transfer what I am reading to my database. I don't know enough about the language required, but have been able to get my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.