|
执行确定后,当调整后的单价为空或与调整前的单价一样,按理会出现一个提示?可是没有反应.(红色处的代码)
Private Sub 确认_Click()
If IsNull(Me.Frame53) Then
MsgBox ("请选择部门!"), vbInformation, "单价调整"
Exit Sub
ElseIf IsNull(组合1) Then
MsgBox ("请选择产品代号!"), vbInformation, "单价调整"
Exit Sub
ElseIf IsNull(Me.调整原因) Then
MsgBox ("请输入调整原因!"), vbInformation, "单价调整"
Exit Sub
ElseIf IsNull(Me.调整人) Then
MsgBox ("请输入调整人!"), vbInformation, "单价调整"
Exit Sub
End If
' If Me.部门1 = Me.部门2 Then
' MsgBox ("调动无效!不可以在同一部门调动!")
' Exit Sub
' End If
Dim bh As String
Dim rq As Date
Dim yy As String
Dim sx As String
Dim bm2 As String
Dim zw2 As String
Dim tzr As String
Dim js As String
Dim sql As String
Dim JJ As String
Dim BJ As String
Dim md As String
Dim xb As String
Dim bz As String
bh = Me.组合1.Column(1)
rq = Me.date
yy = Me.调整原因
tzr = Me.调整人
js = Me.经手人
If Me.Frame53 = 2 Then '彩绘
sx = "彩绘总价:从“" & Me.彩绘单价1 & "”调到“" & Me.彩绘单价2 & "”"
bm2 = Me.彩绘单价2
If IsNull(彩绘单价2) Then
MsgBox "请输入调整后的包装单价", vbInformation, "单价调整"
Exit Sub
End If
If Me.彩绘单价1 = Me.彩绘单价2 Then
MsgBox ("调整前与调整后的单价一样,无须调整!"), vbInformation, "单价调整"
Exit Sub
End If
sql = "insert into 单价调整信息 (产品代号,调整日期,调整事项,调整原因,调整人,经手人)"
sql = sql & " values ('" & bh & "', '" & rq & "' ,'" & sx & "','" & yy & "' , '" & tzr & "','" & js & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
sql = "update 产品表 set 彩绘单价='" & bm2 & "' where 产品代号='" & bh & "'"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
MsgBox ("单价调整成功!"), vbInformation, "单价调整"
Call 组合1_AfterUpdate
ElseIf Me.Frame53 = 3 Then '包装
bz = Me.包装2
sx = "包装单价:从“" & Me.包装1 & "”调到“" & Me.包装2 & "”"
sql = "insert into 单价调整信息 (产品代号,调整日期,调整事项,调整原因,调整人,经手人)"
sql = sql & " values ('" & bh & "', '" & rq & "' ,'" & sx & "','" & yy & "' , '" & tzr & "','" & js & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
sql = "update 产品表查询 set 包装='" & bz & "' where 产品代号='" & bh & "'"
DoCmd.SetWarnings False
DoCmd.RunSQL sql
DoCmd.SetWarnings True
MsgBox ("单价调整成功!"), vbInformation, "单价调整"
Call 组合1_AfterUpdate
ElseIf Me.Frame53 = 1 Then
JJ = Me.灌浆2
md = Me.磨底2
xb = Me.修边2
BJ = Me.白检2
If IsNull(Me.Frame62) Then
MsgBox "请选择工序", vbInformation, "单价调整"
Exit Sub
End If
Select Case Frame62
Case 1 '灌浆
sx = "灌浆单价:从“" & Me.灌浆1 & "”调到“" & Me.灌浆2 & "”"
Case 3 '修边
sx = "修边单价:从“" & Me.修边1 & "”调到“" & Me.修边2 & "”"
Case 2 '磨 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|