thieuhung777
Thành viên mới

- Tham gia
- 3/3/15
- Bài viết
- 9
- Được thích
- 0
Chào anh em
Mình có làm form dữ liệu lọc theo ngày tháng (từ ngày này đến ngày này), nhưng làm xong thì code không có chạy (chỉ tham khao trên diễn đàn), không biết sai ở chỗ nào, mong anh em trên diễn đàn chỉ giúp, đoạn code ở dưới
Private Sub cmdSearch_Click()
Dim conSQL As String
If IsDate(Begindate) And IsDate(EndDate) = False Then
conSQL = "SELECT order, datepacked, part, lot, quantity, comment " & _
"FROM Tableentry9999 " & _
"WHERE ([datepacked]>=[forms]![inputfr].[begindate] And [datepacked]<=[forms]![inputfr].[Enddate]) "
Me.subformsearch1.Form.RecordSource = conSQL
Else
MsgBox "Nothing happends"
Me.Begindate.SetFocus
End If
End Sub
Cám ơn anh em nhiều
Mình có làm form dữ liệu lọc theo ngày tháng (từ ngày này đến ngày này), nhưng làm xong thì code không có chạy (chỉ tham khao trên diễn đàn), không biết sai ở chỗ nào, mong anh em trên diễn đàn chỉ giúp, đoạn code ở dưới
Private Sub cmdSearch_Click()
Dim conSQL As String
If IsDate(Begindate) And IsDate(EndDate) = False Then
conSQL = "SELECT order, datepacked, part, lot, quantity, comment " & _
"FROM Tableentry9999 " & _
"WHERE ([datepacked]>=[forms]![inputfr].[begindate] And [datepacked]<=[forms]![inputfr].[Enddate]) "
Me.subformsearch1.Form.RecordSource = conSQL
Else
MsgBox "Nothing happends"
Me.Begindate.SetFocus
End If
End Sub
Cám ơn anh em nhiều