S
Stephen D Cook
I have a form with 3 text boxes, 2 command buttons and a subform.
The first text box is for the serial number, the other 2 text boxes
are for data associated with the serial number.
The 2 command buttons are for Add and History.
The subform is to display the history, based on the serial number and
is linked to a query which uses the line, [Forms]![frmSN]![txtSN] for
criteria.
The Add command button has DoCmd.GoToRecord , , ACNewRec to add the
new record.
The History button has
DoCmd.ApplyFilter, "[SerialNumber] = Forms!frmSN!txtSN"
If Me.Dirty Then
Me.Dirty = False
End If
The history button works fine at displaying the history in the
subform, and the Add button works fine when adding a new record.
The problem is when I use the History button, then the Add button.
When it should add a record to the table, instead it is updating the
first instance of the Serial Number with the new information.
How do I get the Add button to always add a new record?
The first text box is for the serial number, the other 2 text boxes
are for data associated with the serial number.
The 2 command buttons are for Add and History.
The subform is to display the history, based on the serial number and
is linked to a query which uses the line, [Forms]![frmSN]![txtSN] for
criteria.
The Add command button has DoCmd.GoToRecord , , ACNewRec to add the
new record.
The History button has
DoCmd.ApplyFilter, "[SerialNumber] = Forms!frmSN!txtSN"
If Me.Dirty Then
Me.Dirty = False
End If
The history button works fine at displaying the history in the
subform, and the Add button works fine when adding a new record.
The problem is when I use the History button, then the Add button.
When it should add a record to the table, instead it is updating the
first instance of the Serial Number with the new information.
How do I get the Add button to always add a new record?