⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhdcl.frm

📁 关于图书销售管理
💻 FRM
📖 第 1 页 / 共 3 页
字号:

Private Sub Command10_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close

If Data2.Recordset.BOF = True Then
       Command10.Enabled = False
       Exit Sub
   Else
       Data2.Recordset.MovePrevious
       mark = True
       Call Form_Activate
End If
End Sub

Private Sub Command2_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close

Data2.Recordset.FindFirst "ddbh =  '" & Text1.Text & "'"
Data2.Recordset.Edit
Data2.Recordset("lrrq") = Text2.Text
Data2.Recordset("dhrq") = Text3.Text
Data2.Recordset("jsr") = Text5.Text
Data2.Recordset("ljje") = Text6.Text
Data2.Recordset("dingjin") = Text7.Text


Data2.Recordset.Update
Data2.Refresh
Data1.Recordset.FindFirst "spbh='" & Adodc1.Recordset("spbh") & "'"
Data2.Recordset.Edit
Data2.Recordset("ghs") = Text4.Text
Data2.Recordset.Update
Data2.Refresh

MsgBox "已保存。", vbInformation, "提示"

End Sub

Private Sub Command3_Click()
If Len(Text5.Text) > 50 Then
    MsgBox "备注不要多于25个字", vbCritical, "警告"
    Text5.SetFocus
    Exit Sub
End If
Data2.Recordset.FindFirst "spbh='" & Text16.Text & "'"
Data2.Recordset.Edit
Data2.Recordset("ddbh") = Trim(Text1.Text)
Data2.Recordset("spbh") = Trim(Text16.Text)
Data2.Recordset("jsren") = Trim(Text3.Text)
Data2.Recordset("jhdj") = Trim(Text10.Text)
Data2.Recordset("sl") = Trim(Text15.Text)
Data2.Recordset("je") = Trim(Text11.Text)
Data2.Recordset("bz") = Trim(Text5.Text)
Data2.Recordset("lrrq") = Text2.Text
Data2.Recordset("dhrq") = Text6.Text
Data2.Recordset.Update
Data2.Refresh
Data2.Recordset.MoveLast
incount = Data2.Recordset.RecordCount
Data2.Recordset.MoveFirst
For i = 1 To incount
     jj = Data2.Recordset("jhdj")
     ll = Data2.Recordset("sl")
     je = Data2.Recordset("je")
     Data2.Recordset.Edit
      Data2.Recordset("zk") = jj * ll - je
       Data2.Recordset.Update
     Data2.Recordset.MoveNext
   
Next
   Data2.Refresh
   Call Form_Activate
End Sub

Private Sub Command4_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close
kw.Show
End Sub

Private Sub Command5_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close

     DataGrid1.AllowUpdate = True
        For i = 0 To 8
           On Error Resume Next
           Text9(i).Text = Adodc1.Recordset.Fields(i)
        Next

            Text6.Enabled = True
            Text3.Enabled = True
            Text5.Enabled = True
            Text1.Enabled = True
            Text2.Enabled = True
            Text3.Enabled = True
            Text4.Enabled = True
            Text5.Enabled = True
            Text6.Enabled = True
            Text7.Enabled = True
            Text2.SetFocus

  '           markdj = 2
 '  Else
  '      MsgBox "请先选择好要修改的商品。", vbInformation, "提示"
      
   '    Exit Sub
 'End If
       
End Sub

Private Sub Command6_Click()
    On Error Resume Next
    DataEnvironment1.rsspdhd.Close
       
           'Me.Hide
            Data2.Recordset.FindFirst "ddbh = " & "'" & Text1.Text & "'"
                  
    '****************************************************
                   Msg = "确实要删除此订货单吗?"   ' 定义信息。
                   Style = vbYesNo + vbCritical + vbDefaultButton2   ' 定义按钮。
                   Title = "提示"   ' 定义标题。
                    Ctxt = 1000   ' 定义标题
                   ' 上下文。
                   ' 显示信息。
                   Response = MsgBox(Msg, Style, Title)
                   If Response = vbYes Then   ' 用户按下“是”。
                          MyString = "Yes"   ' 完成某操作。
                          'czrygl.Data1.Recordset.MoveNext
                          'On Error GoTo endthis
                           Text1.Text = ""
                           Text2.Text = ""
                           Text3.Text = ""
                           Text4.Text = ""
                           Text5.Text = ""
                           Text6.Text = ""
                           Text7.Text = ""
                           Data2.Recordset.Delete
                           Data2.Refresh
                           DataGrid1.Refresh
                           'Me.Show
                           'Adodc1.Refresh
                         Else
                           
                           MyString = "No"   ' 完成某操作。
                    End If
    '****************************************
End Sub

Private Sub Command7_Click()
dhdcl1.Text1.Text = Data2.Recordset("ddbh")
DataEnvironment1.spdhd (dhdcl1.Text1.Text)
spdhdrpt.Show
End Sub

Private Sub Command8_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close
cxdd.Show
Me.Hide
End Sub

Private Sub Command9_Click()
On Error Resume Next
DataEnvironment1.rsspdhd.Close

If Data2.Recordset.EOF = True Then
       Command10.Enabled = False
       Exit Sub
   Else
       Data2.Recordset.MoveNext
       Command10.Enabled = True
       mark = True
       Call Form_Activate
     
End If

  'Data4.Recordset.FindFirst "bh='" & Text1.Text & "'"


End Sub

Private Sub DataGrid1_Click()
'markdj = 1
'a = DataGrid1.Row


'Debug.Print DataGrid1.Text
'a = DataGrid1.Row
'b = DataGrid1.Col

End Sub

Private Sub Form_Activate()

'Timer1.Enabled = False
DataGrid1.AllowUpdate = False


DataGrid1.Columns(1).Visible = False

DataGrid1.Columns(0).Width = 1000
DataGrid1.Columns(1).Width = 1000
DataGrid1.Columns(2).Width = 1500
DataGrid1.Columns(3).Width = 1000
DataGrid1.Columns(4).Width = 1000
DataGrid1.Columns(5).Width = 1000
DataGrid1.Columns(6).Width = 1000
DataGrid1.Columns(7).Width = 1000
DataGrid1.Columns(0).Caption = " 商品编号"
DataGrid1.Columns(2).Caption = "  规格"
DataGrid1.Columns(3).Caption = "  单价"
DataGrid1.Columns(4).Caption = "  数量"
DataGrid1.Columns(5).Caption = "  应付金额"
DataGrid1.Columns(6).Caption = "  折扣"
DataGrid1.Columns(7).Caption = "  备注"
If mark = False Then
        Data2.Recordset.MoveFirst
        'Command10.Enabled = False
End If
On Error GoTo endthis
       
Text1.Text = Data2.Recordset("ddbh")
Text2.Text = Data2.Recordset("lrrq")
Text3.Text = Data2.Recordset("dhrq")
'Text4.Text = Data2.Recordset("ghs")
Text5.Text = Data2.Recordset("jsr")
Text6.Text = Data2.Recordset("ljje")
Text7.Text = Data2.Recordset("dingjin")
'Text7.Text = Data2.Recordset("zk")
On Error Resume Next
Data1.Recordset.FindFirst "spbh='" & Adodc1.Recordset("spbh") & "'"
''Text8.Text = Data1.Recordset("spmc")
Text4.Text = Data1.Recordset("ghs")
'Text14.Text = Data1.Recordset("dw")
' Text7.Text = Data1.Recordset("ys")
Adodc1.Recordset.Filter = "  dhdbh =  '" & Text1.Text & "'"

Text1.Enabled = False
Text2.Enabled = False
Text16.Enabled = False
'Text8.Enabled = False
Text6.Enabled = False
Text4.Enabled = False
Text3.Enabled = False
Text5.Enabled = False
Text10.Enabled = False
'Text9.Enabled = False
Text14.Enabled = False
Text15.Enabled = False
Text13.Enabled = False
Text12.Enabled = False
Text11.Enabled = False
Text7.Enabled = False
'DataGrid1.AllowUpdate = True
mark = False
'Data4.Recordset.FindFirst "bh='" & Text1.Text & "'"
'If Data4.Recordset.NoMatch = False Then
'      Command4.Enabled = False
'    Else
'       Command4.Enabled = True
'End If
Data2.Recordset.MoveFirst

Data2.Recordset.FindFirst "ddbh='" & Text1.Text & "'"
If Data2.Recordset("sfrk") = 0 Then
    Command4.Enabled = True
     Else
        Command4.Enabled = False
 End If
 
endthis:
       Exit Sub

End Sub

Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
Data2.DatabaseName = App.Path & "\db1.mdb"
Data2.RecordSource = "select * from spdhd"
Data3.DatabaseName = App.Path & "\db1.mdb"
Data3.RecordSource = "select * from kczk"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb" & ";Persist Security Info=False"
Adodc1.RecordSource = "select spbh,dhdbh,gg,dj,sl,yfje,zk,bz  from  dhdsp  "
Adodc1.Refresh
Label8.Caption = dlm
End Sub


'Sub jiance()
'
'          For t = 0 To 8
'                            If Adodc1.Recordset.Fields(t) <> Text9(t).Text Then
'
'                             '****************************************************
'                                    Msg = "确实要修改当前记录吗?"   ' 定义信息。
'                                    Style = vbYesNo + vbCritical + vbDefaultButton2   ' 定义按钮。
'                                    Title = "提示"   ' 定义标题。
'                                     Ctxt = 1000   ' 定义标题
'                                    ' 上下文。
'                                    ' 显示信息。
'                                    Response = MsgBox(Msg, Style, Title)
'                                    If Response = vbYes Then   ' 用户按下“是”。
'                                           MyString = "Yes"   ' 完成某操作。
'                                           Data2.Recordset.Edit
'                                           Data2.Recordset("ddbh") = Text1.Text
'                                           Data2.Recordset.Update
'                                           Data2.Refresh
'                                          Timer1.Enabled = False
'                                          'Adodc1.Refresh
'                                         ' Exit Sub
'                                           'GoTo endthis
'                                           'czrygl.Data1.Recordset.MoveNext
'                                           'On Error GoTo endthis
'
'                                           'zyxx.Data1.Recordset.Delete
'                                           'zyxx.Data1.Refresh
'                                           'zyxx.Hide
'                                           'Call Form_Activate
'                                           'zyxx.Show
'                                         Else   ' 用户按下“否”。
'
'                                           'For i = 0 To 8
'                                             'Adodc1.Recordset.CancelUpdate
'                                             'Exit Sub
'                                           ' Adodc1.Recordset.EditMode
'                                              For i = 0 To 8
'                                                  On Error Resume Next
'                                                  Adodc1.Recordset.Fields(i) = Text9(i).Text
'                                               Next
'                                            ' Adodc1.Refresh
'                                            MyString = "No"   ' 完成某操作。
'
'                                     End If
'               End If
'    '***************************************************
'      Next
'
'End Sub

Private Sub Frame3_DragDrop(Source As Control, X As Single, y As Single)

End Sub

Private Sub Text1_Click()
MsgBox " 订货单编号不可修改。", vbCritical, "警告"
End Sub


Private Sub Text5_Change()

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -