|
Private Sub 命令48_Click()
On Error GoTo Err_命令48_Click
kdate = ksdate.Value
ktime = kstime.Value
kad = ksad.Value
DoCmd.GoToRecord , , acLast
newdate = Date
khy = Year(newdate)
khm = Month(newdate)
If Len(khm) < 2 Then
khm = "0" & khm
End If
xskh = kh.Value
ksbh = Right(xskh, 4)
newksbh = Val(ksbh) + 1
lksbh = Len(newksbh)
If lksbh < 4 Then
n = 4 - lksbh
cha = ""
For i = 1 To n
cha = cha & "0"
Next
End If
DoCmd.GoToRecord , , acNewRec
ksdate.Value = kdate
kstime.Value = ktime
ksad.Value = kad
sex.Value = "男"
xl.Value = "高中"
kh.Value = "23003" & khy & khm & cha & newksbh
ksname.SetFocus
Exit_命令48_Click:
Exit Sub
Err_命令48_Click:
MsgBox Err.Description
Resume Exit_命令48_Click
End Sub |
|