361
ห้อง MS Access / : จำกัดจำนวนเรคคอดที่รายงาน
« เมื่อ: 13 พ.ค. 63 , 14:54:33 »
สร้าง textbox และใส่โค้ดแบบที่ผมโพสไปครับ
โพสต์นี้ได้รับคำขอบคุณจาก: Un
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.
ผมสร้าง code ดังนี้ เพื่อไม่ให้ Form BB_detail รับข้อมูล
[BB_detail].Form.AllowAdditions = False
[BB_detail].Form.AllowEdits = False
[BB_detail].Form.AllowDeletions = False
แต่มันยังกด command btt ได้ จริงๆ ผมอยากให้ Disable ทั้งหมด คือสั่งอะไรไม่ได้เลย
เมื่อเกิดเหตุการณ์ มีวิธีอะไรบ้างครับ
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me
If ctl.ControlType = acComboBox Then
ctl.Enabled = False
ctl.Locked = True
End If
If ctl.ControlType = acTextBox Then
ctl.Enabled = False
ctl.Locked = True
End If
If ctl.ControlType = acCommandButton Then
ctl.Enabled = False
End If
Next ctl
Forms![BB_detail].Form.AllowAdditions = False
Forms![BB_detail].Form.AllowEdits = False
Forms![BB_detail].Form.AllowDeletions = False
End Sub
acBoundObjectFrame | Bound object frame |
acCheckBox | Check box |
acComboBox | Combo box |
acCommandButton | Command button |
acCustomControl | ActiveX (custom) control |
acImage | Image |
acLabel | Label |
acLine | Line |
acListBox | List box |
acObjectFrame | Unbound object frame or chart |
acOptionButton | Option button |
acOptionGroup | Option group |
acPage | Page |
acPageBreak | Page break |
acRectangle | Rectangle |
acSubform | Subform/subreport |
acTabCtl | Tab |
acTextBox | Text box |
acToggleButton | Toggle button |
สวัสดี ขอถามท่านอาจารย์ เกี่ยวกับการทำรายงานแบบมีเงื่อนไข คือผมอยากเลือกสาขา และ ระหว่างวันที่ หา วันที ครับ ช่วยหน่อยครับมือไหม่
ขอบคุณ ล่วงหน้าครับ
SELECT Employee.ID, Employee.EmployeeCode, Employee.EmployeeName, CStr([EmployeeDivision]) AS EmployeeDivision1, CStr([EmployeeLocation]) AS EmployeeLocation1 FROM Employee WHERE (((CStr([EmployeeDivision]))=[forms]![Form1]![comboDivision]) AND ((CStr([EmployeeLocation]))=[forms]![Form1]![comboLocation]));
อาจารย์แนะนำทีครับผมควรทำใงครับ มันขึ้นฟ้องได้ แต่จะสามารถ เบิกได้ครับแลมีค่าติดลบอยู่
Sub Search()
Dim strSearch As String
For Each varItem In Me!lstMonthSort.ItemsSelected
strSearch = strSearch & " Or SortMonthNum=" & "" & Me!lstMonthSort.ItemData(varItem) & ""
Next varItem
If Len(strSearch) = 0 Then
Me.frmqryHRDWH.Form.FilterOn = False
Else
strSearch = Right(strSearch, Len(strSearch) - 3)
Me.frmqryHRDWH.Form.Filter = strSearch
Me.frmqryHRDWH.Form.FilterOn = True
End If
End Sub