|
本帖最后由 xjliyuehua 于 2009-5-22 13:30 编辑
Me.编号 = Format(Date, "yyyy") & Me.组合4 & Format(Nz(Right(DMax("[编号]", "XXXX", "left([编号],6)='" & Format(Date, "yyyy") & "' & '" & Me.组合4 & "'"), 3)) + 1, "000")
xxxx为你的窗体名
------------------------------完整的------------------------
Private Sub 组合4_AfterUpdate()
Me.组合4.SetFocus
Me.类别 = Me.组合4.Column(1)
' If MsgBox("你确定要修改吗?", vbYesNo, "请确认……") = vbYes Then
' SendKeys "{enter}"
'Else
' SendKeys "{esc}"
'End If
Me.编号 = Format(Date, "yyyy") & Me.组合4 & Format(Nz(Right(DMax("[编号]", "XXXX", "left([编号],6)='" & Format(Date, "yyyy") & "' & '" & Me.组合4 & "'"), 3)) + 1, "000")
Me.收文编号 = Format(Nz(Right([编号], 3)), "000")
Me.文号 = Me.类别 & "(" & Format(Date, "yyyy") & ")" & Format(Nz(Right([编号], 3)), "000") & "号"
End Sub |
|