Private Sub Command16_Click()
Dim GetSerialNo As String
Dim RunNum_Sequence As Integer
DoCmd.GoToRecord , , acNewRec
If IsNull(Sequence) Then
Me.Sequence.Requery
GetSerialNo = DLast("SerialNo", "tblWareHouseAll")
RunNum_Sequence = DMax("Sequence", "tblWareHouseAll", "SerialNo ='" & GetSerialNo & "'")
Me.SerialNo = GetSerialNo
Me.BoxNo = DLookup("BoxNo", "tblWareHouseAll", "SerialNo='" & GetSerialNo & "'")
Me.Shelf = DLookup("Shelf", "tblWareHouseAll", "SerialNo='" & GetSerialNo & "'")
Me.Sequence = RunNum_Sequence + 1
Me.CIFNo.SetFocus
End If
End Sub