entering Info in Combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have set up several combo boxes. Some will let me enter info. not on the
drop down list, others won't. I want to be able to enter an item not on the
list and then update that list for the future. Any help?
 
Rich,
First, set NotInList Off for those combos...

What you are looking for is what I call a "self-referential" combo. It doesn't get
it's values from a separate table, but from all the entries you make on your form.
The query behind the combo looks at all the records you've entered so far, and lists
the different values from that field. (Use a Totals query GroupedBy on that value, and
also Is Not Null)
When you enter a new value in one record, the next time you select from the combo,
that choice will be available.
 
The boxes may be set to only use the list data. Check the "Limit to List"
property and see if any are set to Yes. Or maybe some of your "combo boxes"
are actually just list boxes.

As for your other questions, something similar was asked a few days ago by
"Annemarie", and somebody posted some code there to accomplish this task.

However, you may be able to accomplish the same without code using the
"Requery" feature together with the On Current event. Below is what I came up
with; you may be able to adapt this to your situation.

"First, I created a query on the table that pulls out the names. Then I set
my combo box to be based on that query. Then I made a macro: the action is
"Requery", and in the Control Name field at the bottom I put "names" - the
name of the field in the query with all the names. After that, I went to the
form that holds the combo box, and opened its property sheet. For the "On
Current" field [first one actually] I selected my macro - "requery", and that
was basically it.
Now I can enter a new name into the combo box, and it will be available for
the next new record. Only trouble is, you'll get a new record every time you
enter a name, so you can end up with a lot of duplicates in your query, and
therefore in your combo box. Of course you don't want your combo-box to be
cluttered, so you also need to set the "Unique Values" field on your query's
property sheet to "Yes".
 
Al,
I did what you said...LimitToList was set at yes. I changed it to No and
got a message telling me to "adjust ColumnWidths property first, then set
LimitToList property". ColumWidths+ 0";1.4792";0.6771";| What's that all
about? What do I adjust?
--
Rich D
Armstrong Custom Homes
Redmond


Al Campagna said:
Rich,
First, set NotInList Off for those combos...

What you are looking for is what I call a "self-referential" combo. It doesn't get
it's values from a separate table, but from all the entries you make on your form.
The query behind the combo looks at all the records you've entered so far, and lists
the different values from that field. (Use a Totals query GroupedBy on that value, and
also Is Not Null)
When you enter a new value in one record, the next time you select from the combo,
that choice will be available.
 
Rich,
It's that 0" width column that's causing the problem, and the fact that you probably
have Column 0 as the bound column..
You'll need to use Douglas' suggestion with your setup...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Rich D said:
Al,
I did what you said...LimitToList was set at yes. I changed it to No and
got a message telling me to "adjust ColumnWidths property first, then set
LimitToList property". ColumWidths+ 0";1.4792";0.6771";| What's that all
about? What do I adjust?
 
Well, I copied what that said. I know nothing about code or where to enter
it...I guess it's time I learned. Any suggestions?
 

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

Back
Top