AddItem method doesn't work on my combo

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

Guest

Hello,
I have a combobox which lists few values.
I want the user to be able to choose a value or to enter a new one.
I wrote this precedure:

Private Sub curante_NotInList(NewData As String, Response As Integer)
Response = acDataErrAdded
curante.AddItem UCase(NewData)
End Sub

The new values is added in the combo, but once the forms is closed new
values are lost. If I re-open the form I can only see the few original values.
Why?

NIck
 
The combo RowSourceType Property need to be Table/Query, and the RowSource
need to be a table, so you can add values that will be actually stored in a
table.
If the RowSourceType is a value list then you are not storing this value.

Check this link on how to add a new value to a combo

http://www.databasedev.co.uk/not_in_list.html
 
Thanks,
my problemis that my combi is not linked to any table.
Its RowSourceType is "value list". is there any way to add new values to thi
combobox?
I have tried this:
Response = acDataErrContinue
curante.RowSource = curante.RowSource & ";" & UCase(NewData)
but again, once I close the form I lost all new inserted values..

Nick
 
Sorry, but that's the way it works with a RowSourceType of Value List.

When you created the form, you supplied a list of values to the form.
Unfortunately, when you use AddItem to append to that list, it doesn't get
saved anywhere.
 
that's fine...I will figured out a way...

Douglas J Steele said:
Sorry, but that's the way it works with a RowSourceType of Value List.

When you created the form, you supplied a list of values to the form.
Unfortunately, when you use AddItem to append to that list, it doesn't get
saved anywhere.
 
Back
Top