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

📄 form21.frm

📁 我用VB开发的饲料经营进销存管理程序,包含购入、售出管理
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      Left            =   2400
      TabIndex        =   18
      Top             =   960
      Width           =   1200
   End
   Begin VB.Label Label3 
      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            =   2400
      TabIndex        =   17
      Top             =   1440
      Width           =   1200
   End
   Begin VB.Label Label4 
      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            =   2400
      TabIndex        =   16
      Top             =   1920
      Width           =   1200
   End
   Begin VB.Label Label5 
      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            =   2400
      TabIndex        =   15
      Top             =   2400
      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            =   2400
      TabIndex        =   14
      Top             =   2880
      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            =   2400
      TabIndex        =   13
      Top             =   3360
      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            =   2400
      TabIndex        =   12
      Top             =   3840
      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            =   2400
      TabIndex        =   11
      Top             =   4800
      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            =   2400
      TabIndex        =   10
      Top             =   4320
      Width           =   1200
   End
End
Attribute VB_Name = "Form21"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
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 & "'" & ",备注=" & "'" & _
    Text11.Text & "'" & " where 编号 =" & g_current_number
    With cmd1
        .ActiveConnection = cnn1
        .CommandText = SQL
        .CommandType = adCmdText
        .Execute
    End With
    cnn1.Close
    Set cnn1 = Nothing
    MsgBox ("数据更新成功!")
    Unload Form21
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)
    If rs1.Fields(10) = Null Then
        Text10.Text = ""
    Else
        Text10.Text = rs1.Fields(10)
    End If
    If rs1.Fields(11) = Null Then
        Text11.Text = ""
    Else
        Text11.Text = rs1.Fields(11)
    End If
    cnn1.Close
    Set cnn1 = Nothing
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Select Case g_form
        Case "form28"
            Form28.Show
        Case "form12"
            Form12.Show
    End Select
End Sub

Private Sub Text1_GotFocus()
    Text6.SetFocus
End Sub

Private Sub Text10_Gotfocus()
    Text11.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 Text6_LostFocus()
    Text8.Text = Text6.Text * Text7.Text
End Sub

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

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

Private Sub Text9_GotFocus()
    Text11.SetFocus
End Sub

⌨️ 快捷键说明

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