รันเลขที่ใบเสร็จ แบบ ปี+เดือน+ลำดับ
|
3 Reply in this Topic. Dispaly 1 pages and you are on page number 1
Reply by |
Message
on : 26/12/2560 14:57:16
|
11001 (R24463)
|
Function AotoNo() As String
Dim X As Variant
Dim bk As String
X = DMax("Mid(PicID,1,4)", "RunPicking", "Right(PicID,6) =" & Format(Now(), "DDMMyy"))
If IsNull(X) Then bk = 1 Else bk = X + 1
AotoNo = Format(bk, "0000") & "-" & Format(Now(), "DDMMyy")
Debug.Print "1"
End Function
แล้วก็สร้างตารางเก็บเลขรันnumber
PicID, Date >>>dateเราเก็บวันที่ ตรงDefault เราให้=date()วันที่ปจบ.
Formatก็ดัดแปลงเอาค่ะ
|
Back to Top |
|
|
Reply by |
Message
on : 26/12/2560 16:42:46
|
NAT (R24465)
|

|
Back to Top |
|
|
Reply by |
Message
on : 28/12/2560 10:38:32
|
NAT (R24474)
|
Private Sub Command6_Click()
Me.PicID = AutoNo
End Sub
Function AutoNo() As String
Dim x As Variant
Dim bk As String
x = DMax("mid(PicID,6)", "RunPicking", "left(PicID,4) = " & Format(Now(), "yymm"))
If IsNull(x) Then bk = 1 Else bk = x + 1
AutoNo = "GR" & Format(Now(), "yymm") & "/" & Format(bk, "000")
End Function
ประยุกต์ได้ละค่ะ ขอบคุณน่ะค่ะ
|
Back to Top |
|
|
|
Sorry, you can NOT post a reply.
|