Noname > 14-10-10, 03:06 PM
Private Sub cmdNew_Click()
Dim soCT
DoCmd.GoToRecord , , acNewRec
soCT = DLast("[SoHD]", "tblHoaDon")
SoHD = Format(soCT + 1, "0000000")
End Sub
Private Sub cmdNewReset_Click()
DoCmd.GoToRecord , , acNewRec
SoHD = Format(1, "0000000")
End Sub
manhhung_hvpt > 08-03-11, 04:33 PM
Noname > 08-03-11, 07:16 PM
manhhung_hvpt > 08-03-11, 09:03 PM
Noname > 08-03-11, 10:58 PM
manhhung_hvpt > 08-03-11, 11:30 PM
Noname > 09-03-11, 12:21 AM
manhhung_hvpt > 10-03-11, 12:02 AM
haquocquan > 10-03-11, 12:56 AM
cuong0202 > 13-03-13, 12:29 PM
(10-03-11, 12:56 AM)haquocquan Đã viết: Bạn tham khảo nhé
File
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim KHmax
Dim rskh As Recordset
Set rskh = CurrentDb.OpenRecordset("dmkhnccnv")
If rskh.RecordCount > 0 Then
KHmax = DMax("cint(right([makhnccnv],len([makhnccnv])-4))", "dmkhnccnv")
Else
KHmax = 0
End If
rskh.Close
Set rskh = Nothing
DoCmd.GoToRecord , , acNewRec
Me.makhnccnv.Value = "CU" & Format(KHmax + 1, "0000")
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub