What in this code is stopping me from adding new records?
Private Sub ListProd_Click( )
On Error GoTo GotError
DoCmd.GoToContr ol "[Sales Details]"
Me![Sales Details].Form.AllowAddi tions = True
DoCmd.GoToRecor d , , acNewRec
Me![Sales Details]![ProductID] = Me.ListProd.Col umn(0)
Me![Sales Details].Form.Dirty = False
Me![Sales Details].Form.AllowAddi tions = True
'DoCmd.OpenForm ("Modifiers" )
ExitSub:
Exit Sub
GotError:
Select Case Err.Number
Case 2501
Resume ExitSub
Case Else
MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & "Why Not"
Resume ExitSub
End Select
End Sub
Thanks
DS
Private Sub ListProd_Click( )
On Error GoTo GotError
DoCmd.GoToContr ol "[Sales Details]"
Me![Sales Details].Form.AllowAddi tions = True
DoCmd.GoToRecor d , , acNewRec
Me![Sales Details]![ProductID] = Me.ListProd.Col umn(0)
Me![Sales Details].Form.Dirty = False
Me![Sales Details].Form.AllowAddi tions = True
'DoCmd.OpenForm ("Modifiers" )
ExitSub:
Exit Sub
GotError:
Select Case Err.Number
Case 2501
Resume ExitSub
Case Else
MsgBox Err.Number & vbCrLf & Err.Description & vbCrLf & "Why Not"
Resume ExitSub
End Select
End Sub
Thanks
DS
Comment