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

📄 frm_im_add.frm

📁 《SQL Server 2000课程设计案例精编》-李昆-源代码-3436
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_im_add 
   Caption         =   "添加入库信息"
   ClientHeight    =   3435
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5415
   LinkTopic       =   "Form1"
   ScaleHeight     =   3435
   ScaleWidth      =   5415
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton fault 
      Caption         =   "取消"
      Height          =   375
      Left            =   3240
      TabIndex        =   20
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确定"
      Height          =   375
      Left            =   1080
      TabIndex        =   19
      Top             =   2880
      Width           =   1215
   End
   Begin VB.Frame frameMain 
      Height          =   2535
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   4935
      Begin VB.TextBox Checker 
         Height          =   285
         Left            =   3720
         TabIndex        =   18
         Top             =   1440
         Width           =   975
      End
      Begin VB.TextBox Buyer 
         Height          =   285
         Left            =   3720
         TabIndex        =   16
         Top             =   1080
         Width           =   975
      End
      Begin VB.TextBox Prodplace 
         Height          =   285
         Left            =   3720
         TabIndex        =   14
         Top             =   720
         Width           =   975
      End
      Begin VB.TextBox Prodcom 
         Height          =   285
         Left            =   3720
         TabIndex        =   12
         Top             =   360
         Width           =   975
      End
      Begin VB.TextBox Import_num 
         Height          =   285
         Left            =   1320
         TabIndex        =   10
         Top             =   1080
         Width           =   975
      End
      Begin VB.TextBox Import_price 
         Height          =   285
         Left            =   1320
         TabIndex        =   8
         Top             =   1440
         Width           =   975
      End
      Begin VB.TextBox Import_time 
         Height          =   285
         Left            =   1320
         TabIndex        =   6
         Top             =   1800
         Width           =   975
      End
      Begin VB.TextBox Import_type 
         Height          =   285
         Left            =   1320
         TabIndex        =   4
         Top             =   720
         Width           =   975
      End
      Begin VB.TextBox Import_name 
         Height          =   285
         Left            =   1320
         TabIndex        =   2
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label9 
         Caption         =   "验收员"
         Height          =   255
         Left            =   2520
         TabIndex        =   17
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "采购员"
         Height          =   255
         Left            =   2520
         TabIndex        =   15
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label Label7 
         Caption         =   "产地"
         Height          =   255
         Left            =   2520
         TabIndex        =   13
         Top             =   720
         Width           =   1095
      End
      Begin VB.Label Label6 
         Caption         =   "生产厂家"
         Height          =   255
         Left            =   2520
         TabIndex        =   11
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "入库药品数量"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label Label4 
         Caption         =   "入库药品价格"
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "入库时间"
         Height          =   255
         Left            =   120
         TabIndex        =   5
         Top             =   1800
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "入库药品类型"
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   720
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "入库药品名称"
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frm_im_add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Fault_Click()
    Unload Me
End Sub

Private Sub Cmd_OK_Click()
   If Trim(Import_name.Text) = "" Then
   MsgBox "药品入库名称不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Import_type.Text) = "" Then
   MsgBox "入库药品类型不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Import_num.Text) = "" Then
   MsgBox "药品入库数量不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Import_price.Text) = "" Then
   MsgBox "药品入库价格不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Import_time.Text) = "" Then
   MsgBox "入库时间不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Prodcom.Text) = "" Then
   MsgBox "生产厂商不能为空!", vbOKOnly
     Exit Sub
   End If
   If Trim(Prodplace.Text) = "" Then
   MsgBox "产地不能为空!", vbOKOnly
     Exit Sub
   End If
If Trim(Buyer.Text) = "" Then
   MsgBox "采购员不能为空!", vbOKOnly
     Exit Sub
   End If
If Trim(Checker.Text) = "" Then
   MsgBox "验收员不能为空!", vbOKOnly
     Exit Sub
   End If

OpenDB
Dim strSQL As String
strSQL = "Select * from Drug_Import"
'添加药品入库信息
objRS.Open strSQL, objConn, adOpenKeyset, adLockOptimistic
objRS.AddNew
    objRS.Fields(1).Value = Trim(Import_name.Text)
    objRS.Fields(2).Value = Trim(Import_type.Text)
    objRS.Fields(3).Value = CDbl(Trim(Import_num.Text))
    objRS.Fields(4).Value = CDbl(Trim(Import_price.Text))
    'objRS.Fields(5).Value = CDate(Trim(Import_time.Text))
    objRS.Fields(6).Value = Trim(Prodcom.Text)
    objRS.Fields(7).Value = Trim(Prodplace.Text)
    objRS.Fields(8).Value = Trim(Buyer.Text)
    objRS.Fields(9).Value = Trim(Checker.Text)
objRS.Update
objRS.Close
CloseDB
MsgBox "记录已添加!", vbOKOnly
Unload Me
End Sub


⌨️ 快捷键说明

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