【文章內(nèi)容簡(jiǎn)介】
= (i, 3) = = (i, 4) = (i, 4) = = (i, 5) = (i, 5) = = (i, 6) = (i, 6) = = (i, 7) = (i, 7) = For j = i To ( 2) (j, 0) = (j + 1, 0) (j, 1) = (j + 1, 1) (j, 2) = (j + 1, 2) (j, 3) = (j + 1, 3) (j, 4) = (j + 1, 4) (j, 5) = (j + 1, 5) (j, 6) = (j + 1, 6) (j, 7) = (j + 1, 7) Next j = 1 If = 1 Then = False End If End If End IfEnd SubPrivate Sub cmdEditRecord_Click() Dim c As Integer Dim r As Integer c = 1 r = 1 = + (c) = + (r) If = 1 Then = + 2 * = + 2 * End If = (c) = (r) = True = End SubPrivate Sub Form_Activate() (2).Text = 添加進(jìn)庫(kù)單End SubPrivate Sub Form_Load() = 8 = 1 = 0 = 0 = 材料編碼 = 1 = 材料名稱 = 2 = 規(guī)格型號(hào) = 3 = 計(jì)量單位 = 4 = 數(shù)量 = 5 = 單價(jià) = 6 = 金額 = 7 = 備注 = False = False = False = Date Set Myws = (0) Set Mydb = ( + \) Set Myrs1 = (select * from inlib) Set Myrs2 = (select * from inlibdetail)End SubPrivate Sub MSFlexGrid1_Click() Dim c As Integer Dim r As Integer With MSFlexGrid1 c = .Col r = .Row = + (c) = + (r) If .Appearance = 1 Then = + 2 * = + 2 * End If = .ColWidth(c) = .RowHeight(r) = .Text End With = True End SubPrivate Sub MSFlexGrid1_Scroll() = FalseEnd SubPrivate Sub Text1_Change() = TrueEnd SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then End IfEnd SubPrivate Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then End IfEnd SubPrivate Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then End IfEnd SubPrivate Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then End IfEnd SubPrivate Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then End IfEnd SubPrivate Sub Text6_Change() = End SubPrivate Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then = False End IfEnd SubPrivate Sub Text6_LostFocus() = FalseEnd Sub:代碼分析:Option ExplicitDim Mydb As DatabaseDim myrecordset As RecordsetPrivate Sub Command1_Click() If = True Then = 1 (0, 0) = 進(jìn)庫(kù)單號(hào)碼 (0, 1) = 進(jìn)庫(kù)日期 Set myrecordset = (select * from inlib where 進(jìn)庫(kù)單號(hào)碼=39。 amp。 Trim(Combo1) amp。 39。) Do While Not = + 1 = 1 = 0 = (進(jìn)庫(kù)單號(hào)碼) = 1 = (進(jìn)庫(kù)日期) Loop End If If = True Then If = Then MsgBox 請(qǐng)?zhí)顚懘舜尾樵兊倪M(jìn)庫(kù)日期開始時(shí)間!, vbOKOnly + vbExclamation, 警告 Exit Sub End If If = Then MsgBox 請(qǐng)?zhí)顚懘舜尾樵兊倪M(jìn)庫(kù)日期結(jié)束時(shí)間!, vbOKOnly + vbExclamation, 警告 Exit Sub End If = 1 (0, 0) = 進(jìn)庫(kù)單號(hào)碼 (0, 1) = 進(jìn)庫(kù)日期 Set myrecordset = (select * from inlib where 進(jìn)庫(kù)日期= amp。 amp。 and 進(jìn)庫(kù)日期= amp。 amp。 order by 進(jìn)庫(kù)日期) Do While Not = + 1 = 1 = 0 = (進(jìn)庫(kù)單號(hào)碼) = 1 = (進(jìn)庫(kù)日期) Loop End IfEnd SubPrivate Sub Command2_Click() = 0 InPaperId = Unload MeEnd SubPrivate Sub Command3_Click() Unload Me (2).Text = 編輯進(jìn)庫(kù)單End SubPrivate Sub Form_Load() = 0 = 0 = 進(jìn)庫(kù)單號(hào)碼 = 1 = 進(jìn)庫(kù)日期 = 1 Set Mydb = OpenDatabase( + \) Set myrecordset = (select * from inlib) = True Do While Not (進(jìn)庫(kù)單號(hào)碼) = + 1 = 1 = 0 = (進(jìn)庫(kù)單號(hào)碼) = 1 = (進(jìn)庫(kù)日期) Loop If 0 Then = 0 Else Exit Sub End If End SubPrivate Sub MSFlexGrid1_DblClick() Call Command2_ClickEnd Sub3:進(jìn)庫(kù)材料信息代碼分析:Option ExplicitDim MSFlexGrid1 As MSFlexGridDim Mydb As DatabaseDim myrecordset As RecordsetPrivate Sub Combo1_Change() = TrueEnd SubPrivate Sub Combo1_GotFocus() = TrueEnd SubPrivate Sub Command1_Click() Dim i As Integer Set MSFlexGrid1 = If = Then MsgBox 材料編碼字段不能為空,請(qǐng)?zhí)顚懀? vbOKOnly + vbExclamation, 警告 Exit Sub End If For i = 1 To 1 If (i, 0) = Then MsgBox 表中已經(jīng)存在此材料編碼的記錄!, vbOKOnly + vbExclamation, 警告 = = = = = = = = 39。 Exit Sub End If Next i If = Then MsgBox 材料名稱字段不能為空,請(qǐng)?zhí)顚懀? vbOKOnly + vbExclamation, 警告 Exit Sub End If If = Then MsgBox 規(guī)格型號(hào)字段不能為空,請(qǐng)?zhí)顚懀? vbOKOnly + vbExclamation, 警告 Exit Sub End If If = Then MsgBox 計(jì)量單位字段不能為空,請(qǐng)?zhí)顚懀? vbOKOnly + vbExclamation, 警告 Exit Sub End If If 修理 Then If = Then M