I have a combo box in a form that I need the ability to add new data if necessary. I created the combo tied to a table. here is the code behind the combo box.
Dim demo As ComboBox, strMsg As String
Set demo = Me!CmbCustomer
strMsg = "This Customer is not in the list. Would you like to add it?"
If Msgbox(strMsg, vbOKCancel) = vbOK Then
Response = acDataErrAdded
DoCmd.OpenForm "CUSTOMER"
acFormAdd , acDialog, NewData
Else
CmbCustomer.Undo
Response = acDataErrContinue
End If
I get a problem around the following
acFormAdd, acDialog, New Data....but would like to to be where I add just the new data.
Please help.
Dim demo As ComboBox, strMsg As String
Set demo = Me!CmbCustomer
strMsg = "This Customer is not in the list. Would you like to add it?"
If Msgbox(strMsg, vbOKCancel) = vbOK Then
Response = acDataErrAdded
DoCmd.OpenForm "CUSTOMER"
acFormAdd , acDialog, NewData
Else
CmbCustomer.Undo
Response = acDataErrContinue
End If
I get a problem around the following
acFormAdd, acDialog, New Data....but would like to to be where I add just the new data.
Please help.