NotInList Issue

D

doodle

greetings gurus.
windows xp, access 97

The main form is a switchboard. The subform is an order entry form. The
subform of that form is a parts list for parts ordered. (datasheet)

The part number in the parts list is limited to list. when a part
number is entered that does not exist int he list, the notinlist event
runs. All works fine, except that if the part number they are entering
is the second, third, etc. part number for the order, the first part
number changes to the new number.

Ex:

part # 1: 123456
part # 2: new part adding to list

code runs

part # 1: new part adding to list
123456 no longer exists.

here's my code: (notinlist) and close command for the add part form

Private Sub PartNum_NotInList(NewData As String, Response As Integer)

DoCmd.OpenForm "frmAddPart", datamode:=acFormAdd,
WindowMode:=acDialog, OpenArgs:=NewData
Response = acDataErrAdded
End Sub

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

Forms!frmMainSwitchboard.sbfDemoMain.Form.sfrmCustParts.Form.PartNum =
Me.PartNum

Forms!frmMainSwitchboard.sbfDemoMain.Form.sfrmCustParts.Form.PartNum.Requery
DoCmd.Close acForm, "frmAddPart", acSaveNo

Exit_cmdClose_Click:
Exit Sub

Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top