Adding data to combo box

R

rblivewire

I have a combo box based on a row source and I use this code that I
found from a website for the user to add items other than those in the
combo box. The problem is the items dont save in the combo box. Is
there any way to get them to save?

Private Sub Clothing_Size_NotInList(NewData As String, Response As
Integer)

'Suppress the default error message.

Response = acDataErrContinue

'Prompt user to verify if they wish to add a new value.

If MsgBox(" " & NewData & " is not in list. Add it?", vbYesNo) = vbYes
Then

'Add a new Size to the list with the value from the variable NewData.

[Clothing Size].RowSource = [Clothing Size].RowSource & ";" & NewData

'Inform the combo box that the desired item has been added to the list.

Response = acDataErrAdded

End If

End Sub
 

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