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

📄 form20.frm

📁 我用VB开发的饲料经营进销存管理程序,包含购入、售出管理
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   17
      Top             =   2280
      Width           =   1200
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "单    号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   16
      Top             =   2760
      Width           =   1200
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "购入斤数:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   15
      Top             =   3240
      Width           =   1200
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "购入单价:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   14
      Top             =   3720
      Width           =   1200
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "运    费:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   13
      Top             =   4680
      Width           =   1200
   End
   Begin VB.Label Label10 
      AutoSize        =   -1  'True
      Caption         =   "购入金额:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1980
      TabIndex        =   12
      Top             =   4200
      Width           =   1200
   End
   Begin VB.Label Label11 
      AutoSize        =   -1  'True
      Caption         =   "卸 车 费:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   1950
      TabIndex        =   11
      Top             =   5160
      Width           =   1200
   End
End
Attribute VB_Name = "Form20"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim f_buy_weigh, f_transport_fee, f_unload_fee
Private Sub Command1_Click()
    Dim cnn1 As ADODB.Connection
    Dim cmd1 As ADODB.Command
    Dim rs1 As ADODB.Recordset
    Set cnn1 = New ADODB.Connection
    cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;"
    Set cmd1 = New ADODB.Command
    SQL = "update  品种购入表  set 日期 =" & Text4.Text & ",单号='" & Text5.Text & "'" & _
    ",购入斤数=" & Text6.Text & ",购入单价=" & Text7.Text & ",购入金额=" & Text8.Text & _
    ",运费=" & Text9.Text & ",卸车费 =" & Text10.Text & " where 编号 =" & g_current_number
    With cmd1
        .ActiveConnection = cnn1
        .CommandText = SQL
        .CommandType = adCmdText
        .Execute
    End With
    cnn1.Close
    Set cnn1 = Nothing
    MsgBox ("数据更新成功!")
    Unload Form20
End Sub

Private Sub Form_Load()
    Dim cnn1 As ADODB.Connection
    Dim cmd1 As ADODB.Command
    Dim rs1 As ADODB.Recordset
    Set cnn1 = New ADODB.Connection
    cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;"
    Set cmd1 = New ADODB.Command
    SQL = "SELECT * from 品种购入表 where 编号 =" & g_current_number
    With cmd1
        .ActiveConnection = cnn1
        .CommandText = SQL
        .CommandType = adCmdText
    End With
    Set rs1 = cmd1.Execute
    rs1.MoveFirst
    Text1.Text = rs1.Fields(1)
    Text2.Text = rs1.Fields(2)
    Text3.Text = rs1.Fields(3)
    Text4.Text = rs1.Fields(4)
    Text5.Text = rs1.Fields(5)
    Text6.Text = rs1.Fields(6)
    Text7.Text = rs1.Fields(7)
    Text8.Text = rs1.Fields(8)
    Text9.Text = rs1.Fields(9)
    Text10.Text = rs1.Fields(10)
    cnn1.Close
    Set cnn1 = Nothing
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Select Case g_form
        Case "form43"
            Form43.Show
        Case "form6"
            Form6.Show
    End Select
End Sub

Private Sub Text1_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text10_Gotfocus()
    Text6.SetFocus
End Sub

Private Sub Text2_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text3_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text4_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text5_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text5_LostFocus()
    Dim cnn1 As ADODB.Connection
    Dim cmd1 As ADODB.Command
    Dim rs1 As ADODB.Recordset
    Set cnn1 = New ADODB.Connection
    cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;"
    Set cmd1 = New ADODB.Command
    SQL = " select 金额 from 跟单费用表 where 帐单号 =" & "'" & Text5.Text & "'" & " and " & _
    " 费用名称 = '运费'"
    With cmd1
        .ActiveConnection = cnn1
        .CommandText = SQL
        .CommandType = adCmdText
    End With
    Set rs1 = cmd1.Execute
    If rs1.EOF Then
        f_transport_fee = 0
    Else
        rs1.MoveFirst
        f_transport_fee = rs1.Fields(0)
    End If
    
    SQL = " select 金额 from 跟单费用表 where 帐单号 =" & "'" & Text5.Text & "'" & " and " & _
    " 费用名称 = '卸车费'"
    With cmd1
        .ActiveConnection = cnn1
        .CommandText = SQL
        .CommandType = adCmdText
    End With
    Set rs1 = cmd1.Execute
    If rs1.EOF Then
        f_unload_fee = 0
    Else
        rs1.MoveFirst
        f_unload_fee = rs1.Fields(0)
    End If
    cnn1.Close
    Set cnn1 = Nothing
End Sub

Private Sub Text6_LostFocus()

    If f_buy_weigh > 0 Then
        Text9.Text = f_transport_fee * (Text6.Text / f_buy_weigh)
        Text10.Text = f_unload_fee * (Text6.Text / f_buy_weigh)
    End If
    Text8.Text = Round(Text7.Text * Text6.Text, 2)
End Sub

Private Sub Text7_LostFocus()
    Text8.Text = Text6.Text * Text7.Text
End Sub

Private Sub Text8_GotFocus()
    Text8.Text = Round(Text7.Text * Text6.Text, 2)
End Sub

Private Sub Text9_GotFocus()
    Text6.SetFocus
End Sub

⌨️ 快捷键说明

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