PDA

View Full Version : Auto Fill a combox.. and multiple selection



nepotist
12-15-2008, 07:15 AM
Hey guys, attached is a sample database... I need help in setting the combo box properties.. what i need is that when i click the box and startyping in some thing it should filter the list.. well when i try to do it.. say i select some start typing in some thing and hit enter it edits the other record.. and changes the database.......

Well apart from that I would also like multiple selection possible .. which i know i can do it with listbox.. but my boss wouldnt like it though.. before i say it is not possible with out a list box i wanted to take a third person opinion... can some one help me with that ..
and also please let me know what properties you guys have changes..

thank you

OBP
12-15-2008, 09:12 AM
For Auto Fill see this thread

http://www.vbaexpress.com/forum/showthread.php?t=24186

nepotist
12-15-2008, 09:19 AM
Hey OBP thanks for responding... back well i have that working.. but my problem is that it is editing the data.. i have played around with the properts and nothing seems to work.. i have done some thing like this before.. and they work fine i have even compared all the properties and the set the same for some reason this one dosent work like the other one...
when you open the form in the above example. by default there is a value click the dropdown and start typing in for example dairy adn dairy will be higlited.. instead of selecting it hit enter ... then click back the dropdown again and you will see that the initial value is edited to dairy or what ever you have typed in..

i have even changed the limit to list property of the cmb.. but that dosent work....??

I know this is really a dumb question.. but i am not able to figure it out .. :(

:help:banghead:

Thanks for you time guys..

OBP
12-15-2008, 09:25 AM
Which Form and Combo?

OBP
12-15-2008, 09:30 AM
Ok forget the question.
You have set the Control Source of the Combo without having the Control Source on the form. If you add the control Source and then go to a New record it works fine.
However you are basing the Combo on Query qry1 which is based on the Land Use Categories Table, but so is Your Form???
If you are trying to us ethe Combo to "Find" a record you don not set it's Control Source.
The way that you have it set up is for selecting a Record from one table to put in another table not in to itself.

nepotist
12-15-2008, 09:51 AM
Hey OBP...

I am trying to understand what you stated about... I can see a control source for cbox but not form, it has a record source.. it i remove the query as the record source from form.. then on loading the form it gives me a #NAME as a default value in the CBOX..

If I remove the control source from the CBOX.. dam it works fine...
Thanks for it..

But I wonder how my other application are working fine.... :? ??..

could you please provide me any reference material so that i can understand the control source property better... that would make me not ask any further dumb question :D

Thanks once again

OBP
12-15-2008, 10:19 AM
I don't have any info on reference material other than Books.
The Control Source is where the Value Comes From and Goes to in a Table, it is called being "Bound" to it. So when you select a value in a Combo it goes in to the Field that is it's Control Source. Usually Combos are used to list the data from one table to be selected to put either that value or it's ID number in to another table.
Whereas the "Row Source" of a Combo has the same function as the "Record Source" of a Form, so they shouldn't be the same Table unless you are using the Combo in it's "Find a Record" mode, which is "Unbound". In that case when you select a value in the Combo the form will "Find" the Record that has that value and display it.

nepotist
12-15-2008, 11:23 AM
Got it . Thanks