View Active choices in combobox...

  • Thread starter Thread starter Pelton98
  • Start date Start date
P

Pelton98

What is the best way to only allow active choices in a combobox..

I have a combobox referred to a table that has an end date for the code. I
want only codes to show that have an end date that is null or > Date()

I have been able to do this but for historic records that used the old value
won't display because they aren't in the record source.

I have tried several different methods one is On current select the ones I
want or where the Code Id is equal to Forms.Code.value. This method works
but the records source must requery on every record change.

I also tried onfocus and lostfocus by changing the record source to only
active on got focus and show all when lost focus, but if you scoll through
records and have focus of this field while scolling it won't show the
historic codes.

Am stuck what is the best solution. I am thinking my onfocus and lostfocus
may work and oncurrent for the form set the focus to another field
automatically.
 
Pelton98 said:
What is the best way to only allow active choices in a combobox..

I have a combobox referred to a table that has an end date for the code. I
want only codes to show that have an end date that is null or > Date()

I have been able to do this but for historic records that used the old value
won't display because they aren't in the record source.

I have tried several different methods one is On current select the ones I
want or where the Code Id is equal to Forms.Code.value. This method works but
the records source must requery on every record change. [snip]

The RowSource for the ComboBox needs to Requery with every record change. Is
that what you meant? Why is that a problem? All of your other suggestions
also require that the ComboBox be requeried.
 
That part I get but I since I am using FE/BE DB what would be the least
amount of resources and time. Mainly what even should I put this requery
in. I am going to play around with different variations, just seeing if
anyone had any ideas.


Rick Brandt said:
Pelton98 said:
What is the best way to only allow active choices in a combobox..

I have a combobox referred to a table that has an end date for the code.
I want only codes to show that have an end date that is null or > Date()

I have been able to do this but for historic records that used the old
value won't display because they aren't in the record source.

I have tried several different methods one is On current select the ones
I want or where the Code Id is equal to Forms.Code.value. This method
works but the records source must requery on every record change. [snip]

The RowSource for the ComboBox needs to Requery with every record change.
Is that what you meant? Why is that a problem? All of your other
suggestions also require that the ComboBox be requeried.
 
Back
Top