【文章內(nèi)容簡(jiǎn)介】
D,M_Book_ISBN,M_Book_Prise,M_Book_Num) values(39。 + + 39。,39。 + + 39。,39。 + + 39。,39。 + + 39。) Set rec = (strSql) If = 0 Then MsgBox 成功加入流水賬! , vbOKOnly, 入庫(kù)信息提示 Else MsgBox 數(shù)據(jù)插入錯(cuò)誤 ,請(qǐng)重試! , vbInformation, 入庫(kù)信息提示 Exit Sub End If End Sub Private Sub Command3_Click() If = Then MsgBox 請(qǐng)輸入查詢條件! , 33, 入庫(kù)處理系統(tǒng) ElseIf = 1 Then MsgBox 請(qǐng)選擇查詢類別! , 33, 入庫(kù)處理系統(tǒng) Else Dim strselect1 As String Select Case Case 0 strselect1 = select * from M_Book_Store where M_Book_ISBN = 39。 Case 1 strselect1 = select * from M_Book_Store where M_Book_Author = 39。 Case 2 strselect1 = select * from M_Book_Store where M_Book_Press = 39。 Case 3 strselect1 = select * from M_Book_Store where M_Book_Name = 39。 End Select strselect1 = strselect1 amp。 Replace(Trim(), 39。, 39。39。) amp。 39。 = adCmdText = strselect1 Set = Adodc1 If = 0 Then MsgBox 數(shù)據(jù)庫(kù)中暫無(wú)記錄! End If End If 16 End Sub Private Sub Form_Load() = Provider=。Data Source= amp。 amp。 \。Persist Security Info=False Dim strselect As String strselect = select * from M_Book_Store order by M_Book_ID asc = adCmdText = strselect Set = Adodc1 If = 0 Then MsgBox 數(shù)據(jù)庫(kù)中暫無(wú)記錄! End If End Sub 客戶訂書(shū)單處理 這個(gè)窗體里面也是用代碼將窗體 與訂書(shū)單連接起來(lái),在這里可以看見(jiàn)訂書(shū)單的客戶,根據(jù)客戶的訂書(shū)單來(lái)開(kāi)發(fā)票或者是生成采購(gòu)單,這里發(fā)票和采購(gòu)單用了兩個(gè) frame 窗體,當(dāng)一個(gè)出現(xiàn)的時(shí)候另一個(gè)會(huì)隱藏。點(diǎn)擊開(kāi)發(fā)票會(huì)出現(xiàn)讓你輸入折扣率。 如果輸入的折扣率類型不匹配系統(tǒng)會(huì)提示。如果采購(gòu)單或是發(fā)票已存在系統(tǒng)會(huì)提示你已經(jīng)存在。 圖 45 訂書(shū)單處理數(shù)量足夠開(kāi)發(fā)票界面圖示 17 圖 46 訂書(shū)單處理數(shù)量不足 生成采購(gòu)單 界面圖示 其主要實(shí)現(xiàn)代碼如下: Private Sub Command1_Click() Dim i As Integer If = 1 Then MsgBox 請(qǐng)選擇訂單客戶 , vbInformation, 信息提示 End If Dim str, str1 As String Dim name As String Dim isbn As String name = () str = select M_Book_ISBN,M_Book_Num from M_Book_BKBill where M_Book_CuName= 39。 str = str amp。 Trim(name) amp。 39。 Set rec = (str) If Then Exit Sub Else isbn = rec(M_Book_ISBN).Value End If str1 = select M_Book_ISBN,M_Book_Num from M_Book_All where M_Book_ISBN = 39。 amp。 isbn amp。 39。 Set rec1 = (str1) If Then = 無(wú) 18 = True = True = False = False ElseIf rec(M_Book_Num).Value = rec1(M_Book_Num).Value Then = 有 = 數(shù)量足夠 = True = True = True = False = False Else = 有 = 數(shù)量不足 = True = True = False = True End If If = 無(wú) Or = 數(shù)量不足 Then str = select * from M_Book_BKBill where M_Book_CuName = 39。 amp。 Trim(name) amp。 39。 Set rs = (str) = rs(M_Book_ID).Value = rs(M_Book_Date).Value = rs(M_Book_ISBN).Value = rs(M_Book_Name).Value = rs(M_Book_Author).Value = rs(M_Book_Press).Value = rs(M_Book_PrsDate).Value = rs(M_Book_Num).Value End If Exit Sub End Sub Private Sub Command2_Click() Dim str, s As String Dim name As String Dim str1 As String Dim i As Double 19 Dim str2 As String s = InputBox(請(qǐng)輸入折扣利率 ,必須為 double 型 ,如: , 利率設(shè)定 , Format(0, )) If Not IsNumeric(s) Or IsNull(s) Then MsgBox 折扣利率必須為數(shù)字或者不能為空值 , vbInformation, 信息提示 Else i = CDbl(s) End If name = () str = select * from M_Book_BKBill where M_Book_CuName = 39。 amp。 Trim(name) amp。 39。 Set rs = (str) str1 = select M_Book_Prise from M_Book_Store where M_Book_ISBN = 39。 amp。 rs(M_Book_ISBN).Value amp。 39。 Set rs1 = (str1) = rs(M_Book_ID).Value = rs(M_Book_Date).Value = M_UserName = rs(M_Book_ISBN).Value = rs(M_Book_Name).Value = rs1(M_Book_Prise).Value = rs(M_Book_Num).Value = CStr(CDbl() * CDbl()) = CStr(CDbl() * CDbl() * (1 i)) = CStr(CDbl() * CDbl() CDbl())