|
8#
楼主 |
发表于 2002-12-6 19:57:00
|
只看该作者
就是下面这一段,怎么办?
Dim rpt As Report
Dim strPrm As String '放置输入的查询关键字
'禁止保存提示
DoCmd.SetWarnings False
DoCmd.OpenReport "rptUrge", acViewDesign
Set rpt = Reports!rptUrge
rpt.Visible = False
Select Case pstrKeyWord
Case Is = "Client"
strPrm = InputBox("请输入客户ID:")
If strPrm <> "" Then '判断用户是否输入了内容
'判断是否有相关记录
If DCount("*", "tblPurchaseOrder", "Client ='" & strPrm & "' And OrderStatus = 'Ordered'") <> 0 Then
'修改报表数据源
rpt.RecordSource = "SELECT * FROM tblPurchaseOrder " & _
"WHERE Client ='" & strPrm & "' And OrderStatus = 'Ordered'"
Else
MsgBox conErrRecordUnfound, vbOKOnly + vbExclamation, conTitleSuggest
DoCmd.Close acReport, "rptUrge"
Exit Function
End If
End If
Case Is = "ress" |
|