Ok so I got it working but I need some help combining this code.
The combo box is being is only showing part number that are setup for the chamber type. So the part number may already be in the lookup table but not configured for this chamber type. So I want this code to figure that out and open the right form to either add a new part or open the form to config the part number to the chamber.
Private Sub Part_Number_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_Readme_Click
Dim StdResponse As Integer
DoCmd.SetWarnings False
StdResponse = MsgBox("This Part Number is NOT recorded in the Finger Print. Would you like to add this Part Number?", 52)
If StdResponse = 6 Then 'Yes
DoCmd.OpenForm "Frm-Adding New Parts", acNormal, , , acFormAdd, acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
If Not IsNull(DLookup("[Part Number]", "Tble-Parts LookUp", "[Part Number] = '" & Me![Part Number] & "'")) Then
Dim Msg, Style, Title, Help, Ctxt, Response1, MyString
Msg = "Click YES to ADD this PART to another Product - OR - click NO to add a different PART NUMBER."
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "This Part Number is entered under a different Chamber Type. You can not enter the same part number twice."
Ctxt = 1000
Response1 = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response1 = vbYes Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Frm-Adding Productcodes to PartsC"
stLinkCriteria = "[Part Number]=" & "'" & Me![Part Number] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.Undo
DoCmd.close acForm, "frm-Adding PartsC"
Exit Sub
Else:
End If
End If
Exit Sub
Me.Undo
Exit_Readme_Click:
Exit Sub
Err_Readme_Click:
MsgBox Err.Description
Resume Exit_Readme_Click
End Sub