|
2#
楼主 |
发表于 2007-3-28 18:38:00
|
只看该作者
'计算服装费
Dim lackstr As String
Dim m, n As Integer
If Day(Me.intime) <= 15 Then
n = 1
Else
n = 2
End If
lackstr = Format(Year(DateAdd("m", n, Me.intime)) & "-" & Month(DateAdd("m", n, Me.intime)), "yyyy-mm")
stemp = "INSERT INTO lack"
stemp = stemp & "(emid,shoes,clothing,electricity,others,yearmonth)"
stemp = stemp & "VALUES('" & Me.emid & "',0,50,0,0,'" & lackstr & "')"
DoCmd.RunSQL stemp
n = n + 1
lackstr = Format(Year(DateAdd("m", n, Me.intime)) & "-" & Month(DateAdd("m", n, Me.intime)), "yyyy-mm")
stemp = "INSERT INTO lack"
stemp = stemp & "(emid,shoes,clothing,electricity,others,yearmonth)"
stemp = stemp & "VALUES('" & Me.emid & "',0,50,0,0,'" & lackstr & "')"
DoCmd.RunSQL stemp
MsgBox "社员:" & Me.emname & "的" & Month(Me.intime) + n - 1 & "月与" & Month(Me.intime) + n & "月服装费已预定扣除!", vbInformation, "服装费已扣除"
以上执行的效果也是一样,问题出在那???? |
|