HI,
I have a combobox binded to a table. I want the users to add new names that doesn't appear in the combobox. So if the name is new an ddoesn't appear in the list, the user can add the name to the table and update the combo box so it displays the new name in the list.
Private Sub Caller_Name_NotInList(NewData As String, Response As Integer)
Dim intNewName As Integer, strTitle As String
Dim intMsgDialog As Integer, strMsg As String
Const conClrWhite = 16777215
Const conNormal = 1
strTitle = "Customer Not in List"
strMsg = "Do you want to add name?"
intMsgDialog = "vbYesNo + vbExclamation"
intNewName = MsgBox(strMsg, intMsgDialog, strTitle)
If intNewName = vbYes Then
Caller_Name.Undo
Contact_Name_Query.Enabled = True
Contact_Name_Query = NewData
Phone.Enabled = True
MsgBox "Enter the phone number of the new caller."
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
Else
strMsg = "To modify this caller's name, edit the name in the box below the Caller Name Combo Box."
strMsg = strMsg & "To add a new customer, click Undo Record on the Records menu and then type the "
strgMsg = strMsg & "new name in the Caller Name combo box."
MsgBox strMsg
Caller_Name.Undo
Response = acDataErrContinue
End If
End Sub
I have a combobox binded to a table. I want the users to add new names that doesn't appear in the combobox. So if the name is new an ddoesn't appear in the list, the user can add the name to the table and update the combo box so it displays the new name in the list.
Private Sub Caller_Name_NotInList(NewData As String, Response As Integer)
Dim intNewName As Integer, strTitle As String
Dim intMsgDialog As Integer, strMsg As String
Const conClrWhite = 16777215
Const conNormal = 1
strTitle = "Customer Not in List"
strMsg = "Do you want to add name?"
intMsgDialog = "vbYesNo + vbExclamation"
intNewName = MsgBox(strMsg, intMsgDialog, strTitle)
If intNewName = vbYes Then
Caller_Name.Undo
Contact_Name_Query.Enabled = True
Contact_Name_Query = NewData
Phone.Enabled = True
MsgBox "Enter the phone number of the new caller."
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
Else
strMsg = "To modify this caller's name, edit the name in the box below the Caller Name Combo Box."
strMsg = strMsg & "To add a new customer, click Undo Record on the Records menu and then type the "
strgMsg = strMsg & "new name in the Caller Name combo box."
MsgBox strMsg
Caller_Name.Undo
Response = acDataErrContinue
End If
End Sub