无论是否在else后加“:”,此块都不运行???
Private Sub Form_Load()
DoCmd.SetWarnings off
Dim y, cnt As Integer
Dim a, b, diry As String
cnt = 0
diry = Dir("c:\my documents\ali\b*.xls", vbArchive)
Do Until Len(diry) = 0
diry = Dir
cnt = cnt + 1
Loop
Me.filescnt.Caption = "目录中有 " & cnt & " 个化妆品原料文件可供导入。"
Me.class.Caption = "不匹配列表"
End Sub
Private Sub prin_Click()
If Me.chk1.Value = False Then
If Me.class.Caption = "不匹配列表" Then
DoCmd.OpenReport "ab1", acViewNormal
Else:
DoCmd.OpenReport "proh", acViewNormal
End If
Else:
[I][B] For y = 1 To cnt
a = " b" & y & "不匹配表"
b = "c:\my documents\ali\b" & y & ".xls"
MsgBox Chr(13) & " 准备打印 " & a & Space(3), vbOKOnly, "打印"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "b", b, True
DoCmd.RunMacro "td"
Next y[/B][/I]
End If
End Sub
[此贴子已经被作者于2002-7-3 13:56:06编辑过]
|