Not in List doesn't response

L

Lynda

I have an Address form with data source tblAddress, and
fields are FistName, LastName, City, Province and so on.
Field City is combo box, I want to add a new city name if
the new city name is not in the list. However, I add a
new city, nothing happens, it doesn't trigger event On
NotInList. Can anyone help me? Thanks!
Lynda
I use the following code:
Private Sub City_NotInList(NewData As String, Response As
Integer)

MsgBox "Double-click this field to add an entry to
the list."
Response = acDataErrContinue

End Sub

Private Sub City_DblClick(Cancel As Integer)
On Error GoTo Err_City_DblClick
Dim strCity As String
If IsNull(Me![City]) Then
Me![City].Text = ""
Else
strCity = Me![City]
Me![City] = Null
End If


DoCmd.OpenForm "frmCity", , , , , acDialog, "GotoNew"
Me![City].Requery
If IsNull(strCity) = False Then Me![City] = strCity

Exit_City_DblClick:
Exit Sub

Err_City_DblClick:
MsgBox Err.Description
Resume Exit_City_DblClick

End Sub
 
G

Guest

I solved the problem, I set the Limit to List as No, it
is supposed to yes.
Thanks
Lynda
 

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