0
我有以下代碼,並被要求刪除用戶輸入框並自動提取文件。一個問題是,如果當天是星期一,我們需要將星期五的日期拉入(而不是昨天)。我很抱歉是非常基本的,但我相信我需要用之類的東西來代替InputBox("Input Date")
- 但它不喜歡Day
或DD
。刪除用戶輸入框並用昨天的日期替換(自動化過程)
任何想法? (並感謝您的耐心與我提前)
DoCmd.SetWarnings False
Dim InvDateStr As String
Dim InvDate As Date
Dim Directory_Sheets As String
Dim filename_sheets As String
Dim db As Database
Dim rst As DAO.Recordset
Dim startdate As Date
Dim EndDate As Date
'startdate = #9/23/2010#
'enddate = #1/12/2011#
'InvDate = startdate
'Do Until InvDate = enddate
InvDateStr = InputBox("Input Date")
If InvDateStr = "" Then
Exit Sub
End If
InvDate = CDate(InvDateStr)
Directory_Sheets = FilePath & "Inventory_Surveys\"
On Error Resume Next
' Pull Stores with Inventory
減用'使用DateAdd日(「d 「,-1,inputDate)' –