แสดงกระทู้

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 - akekorn

หน้า: [1]
1
Private Sub Command2_Click()
  Dim rst As ADODB.Recordset
  Set rst = New ADODB.Recordset
    rst.Open "Table1", CurrentProject.Connection, adOpenStatic, adLockOptimistic
         rst.Supports (adUpdate)
         rst.field(0) = txt1.value
         rst.field(1) = txt2.value
         rst.Update     
         rst.close
         rst = nothing

End Sub

ลองดูครับ ว่าได้ไหม
โพสต์นี้ได้รับคำขอบคุณจาก: akekorn

2
แบบที่สอง (น่าจะดีกว่า) คือกรณ๊ที่ ในตารางหลักมีข้อมูลเฉพาะข้อมูลวันสิ้นสุดสัญญา
วิธีการคือเปิดฟอร์มมา แล้ว กดปุ่มประมวลผล 1 ครั้งมันจะคำนวนให้ทุก Record ของตารางหลักเลย


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

ตัวอย่างด้านล่าง
โพสต์นี้ได้รับคำขอบคุณจาก: akekorn

หน้า: [1]