แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - preechaaesanan

หน้า: [1]
1
Join เข้ามาเรื่อยๆ

  :smile:
โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

2
มากขนาดนั้น แนะนำส่งออกเป็น Excel บริหารจัดการรายงานโดย Excel ดีกว่ามั๊ยครับ :grin: :grin: :grin: :grin:
โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

3
ถามเพิ่ม เติม นิดนึงนะครับ   ถ้า เรา จะ ให้มี ตัวอักขระ นำหน้า  เช่น  NC-61070201    หรือ  ตามหลัง เช่น  61070201NC
ต้องตั้งค่าอย่างไรครับ

ถ้าต่อหลังแบบ 61070201NC กำหนดดังนี้

Private Sub ID_DblClick(Cancel As Integer)
Dim strDate As String
Dim intNum As Integer, intMax As Variant
Dim strSuffix As String
Dim strID As String
strID = "NC"

strDate = Format(Date, "yymmdd")
intMax = DMax("Val(Mid([ID],7))", "table1", "Left([ID],6) = '" & strDate & " '")

If Me.ID = "" Or IsNull(Me.ID) Then
        If IsNull(intMax) Then
            intMax = 0
            'Debug.Print "1"
        Else
            intMax = intMax + 1
            If intMax > 99 Then intMax = 0
            'Debug.Print "1"
        End If
        Me.ID = strDate & Format(intMax, "00") & strID
End If
End Sub


ถ้าทำแบบต่อด้านหน้า แบบ NC-61070201 กำหนดดังนี้

Private Sub ID_DblClick(Cancel As Integer)
Dim strDate As String
Dim intNum As Integer, intMax As Variant
Dim strSuffix As String
Dim strID As String
strID = "NC-"
strDate = strID & Format(Date, "yymmdd")

intMax = DMax("Val(Mid([ID],10))", "table1", "Left([ID],9) = '" & strDate & " '")

If Me.ID = "" Or IsNull(Me.ID) Then
        If IsNull(intMax) Then
            intMax = 0
            'Debug.Print "1"
        Else
            intMax = intMax + 1
            If intMax > 99 Then intMax = 0
            'Debug.Print "1"
        End If
        Me.ID = strDate & Format(intMax, "00")
End If
End Sub


โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

4
เผื่อใครต้องการเรียนรู้การตัดสต๊อคสินค้านะครับลองศึกษาดูได้ครับ เป็นAccessเวอร์ชั่น2003และ2016ครับ
-ระบบแยกฐานข้อมูลออกจากฟอร์มและรายงาน
-ตัดบานหน้าต่างนำทางและแถบเมนูออก
-ใช้ระบบส่งข้อมูลยอดขายแยกไว้ในตารางใหม่เพื่อไม่ให้ออกรายงานผิดหากมีการเปลี่ยนแปลงเรื่องราคา
-ระบบตัดสต๊อคทันทีที่ขายโดยไม่ต้องส่งข้อมูลก่อน
-รายงานสต๊อคคงเหลือทันที
-รายงานจุดสั่งซื้อสินค้า

ออกแบบและเขียนแบบง่ายๆเพื่อให้เกิดความเข้าใจสำหรับมือใหม่
หากเกิดข้อผิดพลาดหรือวิธีการไหนที่ดีกว่านี้และง่ายกว่านี้ผมต้องขออภัยด้วยนะครับ เพราะไม่ใช่มืออาชีพสักเท่าไหร่ครับ










โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

5
Private Sub ID_DblClick(Cancel As Integer)
Dim strDate As String
Dim intNum As Integer, intMax As Variant
Dim strSuffix As String

strDate = Format(date, "yymmdd")
intMax = DMax("Val(Mid([ID],7))", "table1", "Left([ID],6) = '" & strDate & " '")

If Me.ID = "" Or IsNull(Me.ID) Then
        If IsNull(intMax) Then
            intMax = 0
            'Debug.Print "1"
        Else
            intMax = intMax + 1
            If intMax > 99 Then intMax = 0
            'Debug.Print "1"
        End If
        Me.ID = strDate & Format(intMax, "00")
End If

End Sub

เมื่อครบ 99 แล้วให้มันกลับเป็น 00 แต่ระวังถ้า Me.ID เป็น primary key มันจะเซฟไม่ได้นะครับเพราะจะมีค่าซ้ำ
โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

6
ลดขนาดของรายงานที่เป็นที่ว่างๆ ที่เห็นมีขนาด 28.5 cm  เขยิบเข้ามาครับ มันเป็นแค่พื้นที่ว่างๆลดขนาดลงมาจนชิด control เลยครับ เนื่องจากมีการตั้งมาร์จิ้นทางซ้ายไว้หลายเซ็น รวมกันพื้นที่ว่างที่มี มันก็จะเกินขนาดของ A4 ทีี่ยาวแค่ 29.7 cm
โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan

หน้า: [1]