1
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.
หน้า: [1]
2
ห้อง MS Access / : รายงานที่ ต้องมี columnเยอะ ต้องทำอย่างไรครับ
« เมื่อ: 22 ก.ย. 61 , 19:44:25 »
มากขนาดนั้น แนะนำส่งออกเป็น Excel บริหารจัดการรายงานโดย Excel ดีกว่ามั๊ยครับ




โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan
3
ห้อง MS Access / : auto increment primary key กำหนด ค่าเริ่มต้น ค่าสุดท้าย ก่อนเริ่มนับรอบใหม่
« เมื่อ: 02 ก.ค. 61 , 19:01:00 »ถามเพิ่ม เติม นิดนึงนะครับ ถ้า เรา จะ ให้มี ตัวอักขระ นำหน้า เช่น 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
ห้อง Ms Access อื่นๆ / วีดีโอแนะนำขั้นตอนการเขียนโปรแกรมขายสินค้าพร้อมตัดสต๊อค
« เมื่อ: 27 พ.ค. 61 , 19:20:43 »
เผื่อใครต้องการเรียนรู้การตัดสต๊อคสินค้านะครับลองศึกษาดูได้ครับ เป็นAccessเวอร์ชั่น2003และ2016ครับ
-ระบบแยกฐานข้อมูลออกจากฟอร์มและรายงาน
-ตัดบานหน้าต่างนำทางและแถบเมนูออก
-ใช้ระบบส่งข้อมูลยอดขายแยกไว้ในตารางใหม่เพื่อไม่ให้ออกรายงานผิดหากมีการเปลี่ยนแปลงเรื่องราคา
-ระบบตัดสต๊อคทันทีที่ขายโดยไม่ต้องส่งข้อมูลก่อน
-รายงานสต๊อคคงเหลือทันที
-รายงานจุดสั่งซื้อสินค้า
ออกแบบและเขียนแบบง่ายๆเพื่อให้เกิดความเข้าใจสำหรับมือใหม่
หากเกิดข้อผิดพลาดหรือวิธีการไหนที่ดีกว่านี้และง่ายกว่านี้ผมต้องขออภัยด้วยนะครับ เพราะไม่ใช่มืออาชีพสักเท่าไหร่ครับ







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







โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan
5
ห้อง MS Access / > auto increment primary key กำหนด ค่าเริ่มต้น ค่าสุดท้าย ก่อนเริ่มนับรอบใหม่
« เมื่อ: 30 เม.ย. 61 , 11:33:39 »
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 มันจะเซฟไม่ได้นะครับเพราะจะมีค่าซ้ำ
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
ห้อง MS Access / > ตั้งค่าหน้ากระดาษผิดตรงไหน
« เมื่อ: 23 มี.ค. 61 , 11:32:12 »
ลดขนาดของรายงานที่เป็นที่ว่างๆ ที่เห็นมีขนาด 28.5 cm เขยิบเข้ามาครับ มันเป็นแค่พื้นที่ว่างๆลดขนาดลงมาจนชิด control เลยครับ เนื่องจากมีการตั้งมาร์จิ้นทางซ้ายไว้หลายเซ็น รวมกันพื้นที่ว่างที่มี มันก็จะเกินขนาดของ A4 ทีี่ยาวแค่ 29.7 cm
โพสต์นี้ได้รับคำขอบคุณจาก: preechaaesanan
หน้า: [1]