tailieunhanh - access 2007 vba bible phần 2

, và xóa các lưu trữ hồ sơ. Thủ tục ArchiveData sử dụng ngày bắt đầu và các giá trị Ngày Kết thúc lựa chọn trong hộp thoại như các đối số. Thủ tục này được liệt kê như sau, cùng với các thủ tục CreateAndTestQuery nó sử dụng để tạo ra một truy vấn lập trình, và một thủ tục | Analyzing Data with Excel 3 FIGURE A dialog form for selecting Northwind Orders data to archive. FIGURE Selecting a date from the calendar pop-up. Once the start date and end date have been entered or selected clicking the Archive button runs a procedure that creates a new Excel worksheet from a template Orders in the same folder as the database fills it with data from tblOrders in the selected date range and deletes the archived records. The ArchiveData procedure uses the Start Date and End Date values selected in the dialog as arguments. This procedure is listed as follows together with the CreateAndTestQuery procedure it uses to create a query programmatically and another procedure TestFileExists that tests whether a file exists in a specific folder Public Sub ArchiveData dteStart As Date dteEnd As Date On Error GoTo ErrorHandler Dim appExcel As Dim intReturn As Integer Dim lngCount As Long Dim n As Long 53 Part I The Office Components and What They Do Best Dim rng As Dim rngStart As Dim strDBPath As String Dim strPrompt As String Dim strQuery As String Dim strSaveName As String Dim strSheet As String Dim strSheetTitle As String Dim strSQL As String Dim strTemplate As String Dim strTemplateFile As String Dim strTemplatePath As String Dim strTitle As String Dim wkb As Dim wks As Create a filtered query using the dates selected in the dialog strQuery qryArchive Set dbs CurrentDb strSQL SELECT FROM tblOrders WHERE _ ShippedDate Between dteStart And _ dteEnd SQL for strQuery strSQL lngCount CreateAndTestQuery strQuery strSQL No. of items found lngCount If lngCount 0 Then Exit if no orders are found in the selected date range strPrompt No orders found for this date range canceling archiving strTitle Canceling MsgBox strPrompt vbOKOnly vbCritical strTitle GoTo ErrorHandlerExit Else strPrompt lngCount orders found in this date range archive them .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.