Private Sub 添加记录_Click()
On Error GoTo Err_添加记录_Click
Me!报检号.BackColor = 16777215 '设置窗体中顾客姓名栏颜色为明,表明可修改
Me!报检日期.BackColor = 16777215
Me!企业名称.BackColor = 16777215
Me!货物名称.BackColor = 16777215
Me!货值.BackColor = 16777215
Me!备注.BackColor = 16777215
Me!新旧状态.Value = True
Me!手工派单.Value = True
Me.保存记录.Enabled = True
Me.删除记录.Enabled = True
Me.报检号.SetFocus
Me.添加记录.Enabled = False
DoCmd.GoToRecord , , acLast '指向最后一条记录
ID = Me.编号.Value
Me.ID.Value = ID
DoCmd.GoToRecord , , acNewRec
Me.编号.Value = Trim(Str(Val(Me.ID.Value) + 1))
If Not IsNull(Me.报检号.Value) Then
Me.ID.Value = Str(Val(Me.ID.Value) + 1)
End If
Exit_添加记录_Click:
Exit Sub
Err_添加记录_Click:
If Me!报检号.Value = Null Then
MsgBox "暂时无记录", vbExclamation, "提示信息"
End If
Resume Exit_添加记录_Click
End Sub
编译错误,请高手指点.