Dim tbl As CRAXDDRT.DatabaseTable
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim m_rpt As String
m_rpt = rs("Path") + "AnalysisCodeList2.rpt"
crystalrpt.reportfilename = m_rpt
crystalrpt.connect = rs("RptConnect")
crystalrpt.ParameterFields(0) = "PrintUser;" & m_curUser & ";true"
crystalrpt.ParameterFields(1) = "AnalysisCategory;" & CStr(Nz(cboAnalysisCategory.Value, "")) & ";true"
If Nz(cboAccountCodeTo.Value, "") <> "" And Nz(cboAccountCodeFm.Value, "") = "" Then
crystalrpt.ParameterFields(2) = "AnalysisCodeRangeStart;" & CStr(Nz(cboAccountCodeFm.ItemData(0), "")) & ";true"
crystalrpt.ParameterFields(3) = "AnalysisCodeRangeEnd;" & CStr(Nz(cboAccountCodeTo.Value, "")) & ";true"
Else
crystalrpt.ParameterFields(2) = "AnalysisCodeRangeStart;" & CStr(Nz(cboAccountCodeFm.Value, "")) & ";true"
crystalrpt.ParameterFields(3) = "AnalysisCodeRangeEnd;" & CStr(Nz(cboAccountCodeTo.Value, "")) & ";true"
End If
crystalrpt.ParameterFields(4) = "AnalysisCodeFilter;" & CStr(Replace(Nz(txtAccountCodeFilter.Value, ""), "*", "~")) & ";true"
crystalrpt.ParameterFields(5) = "MatchCase;" & CStr(Nz(txtMatchCase.Value, "")) & ";true"
crystalrpt.ParameterFields(6) = "Description;" & CStr(Nz(txtDescription.Value, "")) & ";true"
crystalrpt.Action = 1
哇...... vb 6.0自從高中之後我還沒有碰過... – Michael 2012-04-24 08:12:02