Drop down list

G

Guest

Hello:

I am creating a new database which has a field for Sponsor's name, just the
name so it is not worth creating a separate sponsor's table, when an operator
is entering a new sponsor name during data entry I want to have a drop list
list which lists the existing sponsor's names in the same table to select
from as often their are duplicate sponsor names. Is their any way to do this?
 
G

Guest

I would use a Sponser table just because it will be a little fater executing
and base the combo on that. However, if you really don't want to, then you
could base your combo on a query on which ever table the form is based on
that will return all existing sponsers. It would look something like this:

SELECT DISTINCT SomeTable.Sponser FROM SomeTable WHERE SomeTable.Sponser Is
Not Null ORDER BY SomeTable.Sponser;

You can change the field an table names to suit your circumstance and use
that as the row source for your combo. It will return each sponser's name
only once. the Is Not Null is there to avoid create a blank row in your
combo is there are records without a sponser.

Since new sponsers would be added to the table, I would suggest you set the
combo's LimitToList property to No.
 
G

Guest

Almost forgot. If you do add a new sponser, it will not show up in the list
until you requery the combo, so in the After Update event of the form, Put a
line of code to do that:

Me.MyCombNameHere.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top