Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box with filter (?) or selected options based on field

Status
Not open for further replies.

wz

Programmer
Feb 16, 2001
88
US
I want to use a combo box with a filter (I think filter) -

I have a farmer with 2 chicken houses and I want the end user to choose the farmer then have the combo box list the chicken houses and allow them to select which number house. (some farmers just have 1 some have 4, etc.)

ex.

farmer: chicken house number:
Bob 2

Bob is a list box already (with farmer ID). Some farmers have 5 houses some have 4, etc. I only want the list box to show the numbers 1 - 2 - 3 if the farmer only has 3 houses & then the end user can select the house number and if the farmer has just one house I only want the number 1 to show on list box.

farmer is a field
total number of chicken houses is a field

I want the control -that is selected -to be bound to the table (so I have another field as chicken house select)

any ideas - I am pretty sure I need code on this

 
How are ya wz . . .

What code have you tried?

To get started try faq702-4289

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Very crude way....

Have a table with all the numbers from 1 to 100 (called 'numberstable' for this example)

Set the rowsource of the second combobox to:

Select [Number] from [numberstable] where [Number]<=[me!FarmerHuoseCount]

You will have to get the house count from somewhere - this could be a hidden colum in the first combo box.


This is simple, but not great as if any farmer got to over 100 it would break. Yuo can generate a combo box using code on the fly.



SeeThru
Synergy Connections Ltd - Telemarketing Services

 
thanks to both of you!!!

I won't get to work on this until next week (I work from home helping out a Tech Adv.) - I'll let you know then (until then I've got 3 kids to manage :) wz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top