Add fielf to combobox from an inputbox

F

Fred

Sorry to ask again but its really urgent..

I have some combobox with a few fields (The values listed are not from a
table, i just wrote them) previously added and one of them is
called "Add new park".. i'm trying to create a code that when this option is
chosen opens a inputbox so the user can fill it with the new field he wants
to add..
i imagine it starts with..
private Sub Combo_Exit (Cancel as Integer)
dim i as double
if Combo.text = "Add new park" then
msgbox "Sure you want to add?"
i = inputbox ("Write new park name", "Park", "")
...............
i cant figure the next code on this routine.. to add it to the item list of
the combobox

Can you help me please...
Thanks
 
N

NetworkTrade

I myself would not try this method whereby you are having users dynamically
add to a field list combobox. It seems complicated. I would source the
combobox on a table.

In your form if the user does not find a selection and wish to add - then
you can make visible a subform or a popup form that is sourced on this table
 
F

Fred

Ok.. i'll try to do it that way..but can you explain whqat i need to do please?

I create a table with the field i need.. and then?

Sorry but i'm really new at access..
Thanks..
Nuno
 
N

NetworkTrade

Assuming your form1 with combobox works ok.

Make a new form2 sourced on table (that feeds combobox) ; in the property of
this form make 'PopUp' to 'yes'.

In form1 add a button 'Add new entry' and define that button to open form2.

form1 will need to either refresh (close/open) (or the combobox must
requery) to have this new entry appear.
 

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

Top