1
ห้อง MS Access / : เมื่อครบ 3 ครั้งต่อวันให้แจ้งเตือน
« เมื่อ: 28 พ.ย. 65 , 19:03:41 »
โพสต์นี้ได้รับคำขอบคุณจาก: naekkhung
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.
ปุ่มก็ได้ครับ ขอถามเพิ่มครับแล้วถ้าเกิดผมมีเงื่้อนไขเพิ่ม กรณีผมมีฟิวส์ชื่อ monthly เก็บข้อมูลเดือน Jan-Dec และฟิวส์ sex เก็บเพศ ชาย หญิง ความต้องการคือให้กรองข้อมูลเฉพาะเดือน May เพศเลือก ชาย ให้เอาข้อมูล TCC มา Random เขียนแบบไหนครับ
Private Sub Text20_AfterUpdate()
Dim DatePK As String
DatePK = Me.Text20 - Date
If DatePK > 30 Or DatePK < 0 Then
MsgBox "กรุณาเลือกวันที่ " & Date & " - " & Date + 30, vbCritical, "แจ้งเตือน"
Me.Text20 = Null
End If
End Sub
มีฟอร์มทั้งหมด 2 ฟอร์มชื่อ "collection","ข้อมูลทั้งหมด" ทั้ง 2 ฟอร์มพนักงานจะเปิดใช้พร้อมกัน
คำถามคือ ปัจจุบันผมใช้งานอยู่หน้าฟอร์ม collection และจะเปลี่ยนไปใช้หน้าฟอร์ม ข้อมูลทั้งหมด อยากให้ ฟอร์ม collection ปิดอัตโนมัติต้องทำยังไงครับ
ขอบคุณมากๆเลยครับ แต่ตอนนี้ถ้าเกิด text1 เราไม่ต้องการกรอกข้อมูล แต่ตอนรวม มันจะมีค่าเว้นวรรคมาด้วย ถ้าเราไม่ต้องการทำยังไงครับใช้ Trim เข้ามาช่วยครับ
Option Compare Database
Public strText1, strText2, strText3 As Variant
Private Sub Form_Current()
Me.total = strText1 & " " & strText2 & " " & strText3
End Sub
Private Sub Text1_Change()
If Len(Me.Text1.Text) > 0 Then
strText1 = Me.Text1.Text
End If
Me.total = strText1 & " " & strText2 & " " & strText3
End Sub
Private Sub Text2_Change()
If Len(Me.Text2.Text) > 0 Then
strText2 = Me.Text2.Text
End If
Me.total = strText1 & " " & strText2 & " " & strText3
End Sub
Private Sub Text3_Change()
If Len(Me.Text3.Text) > 0 Then
strText3 = Me.Text3.Text
End If
Me.total = strText1 & " " & strText2 & " " & strText3
End Sub
Private Sub Text5_AfterUpdate()
GetNum = Me.Text5
Select Case GetNum
Case "1": Me.Command1.Enabled = True
Case "2": Me.Command2.Enabled = True
Case "3": Me.Command3.Enabled = True
Case "4": Me.Command4.Enabled = True
End Select
End Sub
Private Sub Text5_AfterUpdate()
GetNum = Me.Text5
Select Case GetNum
Case "1": Me.Command1.Visible = True
Case "2": Me.Command2.Visible = True
Case "3": Me.Command3.Visible = True
Case "4": Me.Command4.Visible = True
End Select
End Sub