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
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