Help with combo boxes.

  • Thread starter Thread starter smjohnson1
  • Start date Start date
S

smjohnson1

I am trying to use a combo box based on an existing table. I have set
up the combo box such that it filters the entries as follows.

Row Source = SELECT DISTINCTROW Members.* FROM Members WHERE

(((Members.Current)=Yes)) ORDER BY
Members.ID;

Where "Members" is a table and "Current" is a "Yes/No" field in the
table.

The problem that I have is that if I change an entry in the
"Members.Current" field to "No" the combo box is filtered only showing
the members that are current, which is what I want, but previously
entered data is not displayed.

For example if I had a form that showed how much members had spent and
I wanted to keep all past data regardless of if the person was a
current member, this method doesn't seem to work the way I am trying to
use it.

How do I get a combo box filtered based on current members while
leaving previously entered data untouched?

Any help would be greatly appreciated.

Thanks in advance.
 
Make your combo box query like the following:

SELECT ID, LN & ", " & FN AS Dev
FROM tblDeveloper
WHERE ActiveSW=True OR ID = NZ([Forms]![frmActivities]![DevID],0)
ORDER BY LN, FN;

As you can see, it matches on the switch OR the current value.

-Dorian
 
SELECT ID, LN & ", " & FN AS Dev
FROM tblDeveloper
WHERE ActiveSW=True OR ID = NZ([Forms]![frmActivities]![DevID],0)
ORDER BY LN, FN;

I really appreciate the response, and I think I can see what I'm
supposed to try to be doing. Unfortunately, I must admit that I am not
100% sure how to apply what you suggested. I am not sure what ID LN
and FN are.

If its not too much trouble could you please explain a little more.

Thanks again.
 
Back
Top