Hello there!
I have a list box and a combo box.
I have for row source the same field of array at both the list box and the combobox.
All i want is, when i select a value from the combo box, the same value from the list box to disappear.
I have written a piece of code at list box:
SELECT table1.surname from table1 where table1.surname Not In (nz([Forms]![my_form]![combobox_name]), etc
and i have writter at after update of combo box, the code:
me.listbox_name.requery.
This works just fine, but i have lots of combo boxes and i get an sql message that i have passed way the limit of 1024 characters of code, so i am looking to another way to settle the other combo boxes.
I was thinking a sample code at after update of a combo box like:
if me.listbox_name.rowsource = me.combobox_name.value then
me.listbox_name.rowsource = ""
me.listbox_name.requery
but it doesn't work.
Does anyone know how could i declare this statement correctly so i can get this work?
Thanks in advance
I have a list box and a combo box.
I have for row source the same field of array at both the list box and the combobox.
All i want is, when i select a value from the combo box, the same value from the list box to disappear.
I have written a piece of code at list box:
SELECT table1.surname from table1 where table1.surname Not In (nz([Forms]![my_form]![combobox_name]), etc
and i have writter at after update of combo box, the code:
me.listbox_name.requery.
This works just fine, but i have lots of combo boxes and i get an sql message that i have passed way the limit of 1024 characters of code, so i am looking to another way to settle the other combo boxes.
I was thinking a sample code at after update of a combo box like:
if me.listbox_name.rowsource = me.combobox_name.value then
me.listbox_name.rowsource = ""
me.listbox_name.requery
but it doesn't work.
Does anyone know how could i declare this statement correctly so i can get this work?
Thanks in advance