I have a form that checked to see if a part number was entered into the DB. I Have made some code to check and if the part was not entered open up the part entry form for them to enter it in. The problem I am facing is that once they are done entering the new part in and close the form the first form kicks out of the current record it was on and goes back to record 1. Here is the code I am using. Can anyone tell me why this happens?
Thanks
Sean
Dim partanswer As String
If IsNull(DLookup("[PRT_PartNumber]", "PRT", "[PRT_PartNumber] = '" & Me!Cmboprtnum.Value & "'")) Then
partanswer = MsgBox("The Part Number " & Me.Cmboprtnum.Value & " Is not in the Item card. Would you like to add it now?", vbYesNo)
End If
If partanswer = vbYes Then
DoCmd.OpenForm "frmNewPart", acNormal, , , acFormAdd, acDialog
Else
Cancel = True
End If
Thanks
Sean
Dim partanswer As String
If IsNull(DLookup("[PRT_PartNumber]", "PRT", "[PRT_PartNumber] = '" & Me!Cmboprtnum.Value & "'")) Then
partanswer = MsgBox("The Part Number " & Me.Cmboprtnum.Value & " Is not in the Item card. Would you like to add it now?", vbYesNo)
End If
If partanswer = vbYes Then
DoCmd.OpenForm "frmNewPart", acNormal, , , acFormAdd, acDialog
Else
Cancel = True
End If