【正文】
(0).Text) PurchaseDateto = Trim(txtDate(1).Text) RejectDatefrom = Trim(txtDate(2).Text) RejectDateto = Trim(txtDate(3).Text) If Len(Pricefrom) 0 Then If Not IsNumeric(Pricefrom) Then MsgBox 購(gòu)買價(jià)格輸入不正確,請(qǐng)重新輸入。 Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND ProductPrice= amp。 Pricefrom Else strSQL = ProductPrice= amp。 Pricefrom End If End If End If If Len(Priceto) 0 Then If Not IsNumeric(Priceto) Then MsgBox 購(gòu)買價(jià)格輸入不正確,請(qǐng)重新輸入。 Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND ProductPrice= amp。 Priceto Else strSQL = ProductPrice= amp。 Priceto End If End If End If If Len(PurchaseDatefrom) 0 Then If Not IsDate(PurchaseDatefrom) Then MsgBox 購(gòu)買日期輸入不正確,請(qǐng)重新輸入。 txtDate(0).SetFocus Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND PurchaseDate= amp。 PurchaseDatefrom amp。 Else strSQL = ProductPrice= amp。 PurchaseDatefrom amp。 End If End If End If If Len(PurchaseDateto) 0 Then If Not IsDate(PurchaseDateto) Then MsgBox 購(gòu)買日期輸入不正確,請(qǐng)重新輸入。 txtDate(1).SetFocus Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND PurchaseDate= amp。 PurchaseDateto amp。 Else strSQL = ProductPrice= amp。 PurchaseDateto amp。 End If End If End If If Len(RejectDatefrom) 0 Then If Not IsDate(RejectDatefrom) Then MsgBox 注銷日期輸入不正確,請(qǐng)重新輸入。 txtDate(2).SetFocus Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND RejectDate= amp。 RejectDatefrom amp。 Else strSQL = RejectDate= amp。 RejectDatefrom amp。 End If End If End If If Len(RejectDateto) 0 Then If Not IsDate(RejectDateto) Then MsgBox 注銷日期輸入不正確,請(qǐng)重新輸入。 txtDate(3).SetFocus Exit Sub Else If Len(strSQL) 0 Then strSQL = strSQL amp。 AND RejectDate= amp。 RejectDateto amp。 Else strSQL = RejectDate= amp。 RejectDateto amp。 End If End If End If If Len(DeviceName) 0 Then If Len(strSQL) 0 Then strSQL = strSQL amp。 AND DeviceName LIKE 39。% amp。 DeviceName amp。 %39。 Else strSQL = DeviceName LIKE 39。% amp。 DeviceName amp。 %39。 End If End If If Len(DeviceModel) 0 Then If Len(strSQL) 0 Then strSQL = strSQL amp。 AND DeviceModel LIKE 39。% amp。 DeviceModel amp。 %39。 Else strSQL = DeviceModel LIKE 39。% amp。 DeviceModel amp。 %39。 End If End If If Len(strSQL) 0 Then strSQL = SELECT a.*, FROM (tblDevice AS A INNER JOIN tblDepartment AS B ON =) INNER JOIN tblTypeInfo C ON = WHERE amp。 strSQL amp。 ORDER BY DESC Else strSQL = SELECT a.*, FROM (tblDevice AS A INNER JOIN tblDepartment AS B ON =) INNER JOIN tblTypeInfo C ON = ORDER BY DESC End If = fillDeviceGrid grdQuery, strSQLEnd SubPrivate Sub cmdReject_Click() Dim iid As String Dim strDate As String With grdDevice If .Row = 0 Then MsgBox 請(qǐng)選擇要注銷的資產(chǎn)! Else If MsgBox(你是否真的要注銷當(dāng)前選擇的資產(chǎn)嗎?注銷后將不能恢復(fù)!, vbOKCancel) = vbOK Then .Col = 1 iid = .Text strDate = getDate() If Len(strDate) 0 Then Dim device As New classDevice If (iid, strDate) = True Then .Tag = fillDeviceGrid grdDevice End If Set device = Nothing End If End If End If End WithEnd SubPrivate Sub cmdReport1_Click() Dim report As New drDevice Dim rs As Set rs = (SELECT * FROM tbldevice) With report Set .DataSource = rs .DataMember = .Show vbModal End With Set report = NothingEnd SubPrivate Sub cmdReport2_Click() Dim report As New drDepartment Dim rs As Set rs = (SELECT department,count(*) as countofDevice, sum(productprice) as sumofDevice FROM tbldevice a inner join tbldepartment b on = group by ) With report Set .DataSource = rs .DataMember = .Show vbModal End With Set report = NothingEnd SubPrivate Sub cmdReport3_Click() Dim report As New drReject Dim rs As Set rs = (SELECT devicename, department,rejectdate FROM tbldevice a inner join tbldepartment b on = where rejectdate is not null) With report Set .DataSource = rs .DataMember = .Show vbModal End With Set report = NothingEnd SubPrivate Sub cmdReport4_Click() Dim report As New drCost Dim rs As Set rs = (SELECT devicename, department,productprice, productcost FROM tbldevice a inner join tbldepartment b on =) With report Set .DataSource = rs .DataMember = .Show vbModal End With Set report = NothingEnd SubPrivate Sub cmdReset_Click() If MsgBox(你是否真的要重置數(shù)據(jù)庫(kù)嗎?這個(gè)操作將會(huì)刪除所有記錄!, vbOKCancel + vbDefaultButton2) = vbOK Then delete from tbldevice delete from tbluser delete from tbllend insert into tbluser (login,pwd,level) values (39。admin39。,39。88839。,1)