Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store a user entry into a como box

Status
Not open for further replies.

kjy

Technical User
Jun 18, 2002
15
US
still working on the same problem from last week. I need to be able to add a user entry into a combo box. The combo box comes with a default number of options, so supposed the user looks at those options and decides that his/her desired entry is not there, so he/she needs to be able to add that option into the combo box so later he/she can simply go and pick that option from the combo box and not have to type it in every time. I can set up my macro to do everything except copy the user input... what happens now is that I copy the entire database page (i checked this by outputting the context into a wordpad file) so if anyone knows how to go about doing this, I'd be greatly appreciative. Please feel free to ask questions if there is some confusion, I'll be back on the board off and on during the day.

Cheers
 
If i understand you correctly this is what you need to do; first off the combobox needs to be bound to the form. Second under the properties of the combo box set the row source type to table/query. Next look at the Row Source, to use the row source builder click the ... this should bring up a blank query along with your show table window select the table where the field will becoming from then select the field into your query. There should only be one field in the query set that to Group By, ascending and in the criteria Is Not Null this will make it so you don't get any blanks in your combo box. Under your properties you need to have the bound column read 1, column count reads 1. You will also need to requery the combo box in the after update experssion if you add a new intem into the combo box.
Hope this helps
 
I don't see what you mean when you talk about the row source operation. Also, what does it mean to update the expression?
 
Your best bet for this is to abandon macro's and venture into VBA.

First off check that the combo box Limit To List property is set to No. Bring up the properties for the combo box and it should be in the data tab.

After that go to the Event tab and click the ... on the On Not In List Event, then select code builder.

Read this thread: thread181-296040 from when you asked this question earlier.

I think it's the second or third reply that gives you the code you should use. Just paste it straight into the On Not In List event code.

I happened to need exactly the same thing today and it's worked fine, let me know if it doesn't work for you.

Pete
 
OK, I can update my form, through a user interface now. But the updated form entries don't appear on my combo box as a choice. Also, the user has to type the word in again, is there any way to make it so that program knows what the user typed in previously and automatically adds that entry into the list of choices using VB?

Also, after I close the input record box, I still get the error that says "The text you entered isn't an item in the list" please advise....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top