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

📄 frmrukugl.frm

📁 能实现数据库的查询,修改,实用于一些用户的要求,实现基本的数据库功能.
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmrukugl 
   BackColor       =   &H0080FF80&
   Caption         =   "入库数据管理"
   ClientHeight    =   7410
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10290
   LinkTopic       =   "Form2"
   ScaleHeight     =   7410
   ScaleWidth      =   10290
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   375
      Left            =   3360
      TabIndex        =   26
      Top             =   4320
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "取消"
      Height          =   375
      Left            =   5280
      TabIndex        =   25
      Top             =   4320
      Width           =   1215
   End
   Begin VB.TextBox Text11 
      Height          =   375
      Left            =   4200
      TabIndex        =   21
      Top             =   3720
      Width           =   615
   End
   Begin VB.TextBox Text10 
      Height          =   375
      Left            =   3120
      TabIndex        =   20
      Top             =   3720
      Width           =   615
   End
   Begin VB.TextBox Text9 
      Height          =   375
      Left            =   6840
      TabIndex        =   19
      Top             =   3720
      Width           =   1215
   End
   Begin VB.TextBox Text8 
      Height          =   375
      Left            =   2040
      TabIndex        =   18
      Top             =   3120
      Width           =   6015
   End
   Begin VB.TextBox Text7 
      Height          =   375
      Left            =   2040
      TabIndex        =   17
      Top             =   3720
      Width           =   615
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   6120
      TabIndex        =   16
      Top             =   2520
      Width           =   1935
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   2040
      TabIndex        =   15
      Top             =   2520
      Width           =   1815
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   6120
      TabIndex        =   14
      Top             =   1920
      Width           =   1935
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   2040
      TabIndex        =   13
      Top             =   1920
      Width           =   1815
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   6120
      TabIndex        =   12
      Top             =   1320
      Width           =   1935
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   2040
      TabIndex        =   11
      Top             =   1320
      Width           =   1815
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   1440
      Top             =   9120
      Width           =   3015
      _ExtentX        =   5318
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select  * from qcml"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "frmrukugl.frx":0000
      Height          =   2415
      Left            =   120
      TabIndex        =   10
      Top             =   4920
      Width           =   10215
      _ExtentX        =   18018
      _ExtentY        =   4260
      _Version        =   393216
      AllowUpdate     =   0   'False
      AllowArrows     =   0   'False
      BackColor       =   12648384
      ForeColor       =   16711680
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Label Label13 
      BackStyle       =   0  'Transparent
      Caption         =   "日"
      Height          =   375
      Left            =   4920
      TabIndex        =   24
      Top             =   3840
      Width           =   495
   End
   Begin VB.Label Label12 
      BackStyle       =   0  'Transparent
      Caption         =   "月"
      Height          =   495
      Left            =   3840
      TabIndex        =   23
      Top             =   3840
      Width           =   375
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "年"
      Height          =   375
      Left            =   2760
      TabIndex        =   22
      Top             =   3840
      Width           =   375
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "操作员"
      Height          =   495
      Left            =   6000
      TabIndex        =   9
      Top             =   3720
      Width           =   615
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "供货单位"
      Height          =   495
      Left            =   840
      TabIndex        =   8
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Label Label8 
      BackStyle       =   0  'Transparent
      Caption         =   "入库时间"
      Height          =   495
      Left            =   840
      TabIndex        =   7
      Top             =   3840
      Width           =   1215
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "补充数量"
      Height          =   495
      Left            =   5040
      TabIndex        =   6
      Top             =   2640
      Width           =   1215
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "库存数量"
      Height          =   495
      Left            =   840
      TabIndex        =   5
      Top             =   2640
      Width           =   1215
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "库存标准"
      Height          =   495
      Left            =   5040
      TabIndex        =   4
      Top             =   2040
      Width           =   1215
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "存储单位"
      Height          =   495
      Left            =   840
      TabIndex        =   3
      Top             =   2040
      Width           =   1215
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "器材名称"
      Height          =   495
      Left            =   5040
      TabIndex        =   2
      Top             =   1440
      Width           =   1215
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "器材代码"
      Height          =   495
      Left            =   840
      TabIndex        =   1
      Top             =   1440
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "入库数据管理"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   615
      Left            =   3360
      TabIndex        =   0
      Top             =   360
      Width           =   3015
   End
End
Attribute VB_Name = "frmrukugl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public flag As Integer              'flag=1为增加,flag=2 为修改


Private Sub Command1_Click()
Unload Me



End Sub

Private Sub Command2_Click()
frmrukugl.flag = 1          'flag为在 frmQcmledit中设置的公共变量,可被外部过程引用,但须加上对象名
'首先要判断录入数据的有效性
    '器材代码不能为空值
    If Trim(Text1.Text) = "" Then
        MsgBox "器材代码不能为空,请重新设置!", vbInformation, "提示"
        Text1.SetFocus        '焦点返回
        Exit Sub                        '退出子程序
    End If
    
    If flag = 1 Then
        With frmrukugl.Adodc1.Recordset
            .AddNew
            .Fields!qcdm = Trim(Text1.Text)
            .Fields!dw = Trim(Text3.Text)
            .Fields!mc = Trim(Text2.Text)
            .Fields!kcbz = Val(Text4.Text)
            .Fields!kcsl = Val(Text5.Text)
            .Fields!补充数量 = Val(Text6.Text)
            .Fields!年 = Val(Text7.Text)
            .Fields!月 = Val(Text10.Text)
            .Fields!日 = Val(Text11.Text)
            .Fields!供货单位 = Trim(Text8.Text)
            .Fields!操作员 = Trim(Text9.Text)
            
           ' .Update
        End With
    End If
    
    
    If flag = 2 Then
        With frmrukugl.Adodc1.Recordset
            .Fields!qcdm = Trim(Text1.Text)
            .Fields!dw = Trim(Text3.Text)
            .Fields!mc = Trim(Text2.Text)
            .Fields!kcbz = Val(Text4.Text)
            .Fields!kcsl = Val(Text5.Text)
            .Fields!补充数量 = Val(Text6.Text)
            .Fields!年 = Val(Text7.Text)
            .Fields!月 = Val(Text10.Text)
            .Fields!日 = Val(Text11.Text)
            .Fields!供货单位 = Trim(Text8.Text)
            .Fields!操作员 = Trim(Text9.Text)
            .Update
        End With
    End If
   
   
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
   Text4.Text = ""
   Text5.Text = ""
   Text6.Text = ""
   Text7.Text = ""
   Text8.Text = ""
   Text9.Text = ""
   Text10.Text = ""
   Text11.Text = ""
   


End Sub

Private Sub Command3_Click()
'首先要判断录入数据的有效性
    '器材代码不能为空值
    If Trim(txtqcdm.Text) = "" Then
        MsgBox "器材代码不能为空,请重新设置!", vbInformation, "提示"
        txtqcdm.SetFocus        '焦点返回
        Exit Sub                        '退出子程序
    End If
    
    If flag = 1 Then
        With frmQcml.Adodc1.Recordset
            .AddNew
            .Fields!qcdm = Trim(txtqcdm.Text)
            .Fields!dw = Trim(txtdw.Text)
            .Fields!mc = Trim(txtdw.Text)
            .Fields!kcbz = Val(txtkcbz.Text)
            .Fields!kcsl = Val(txtkcsl.Text)
            .Update
        End With
    End If
    
    
    If flag = 2 Then
        With frmQcml.Adodc1.Recordset
            .Fields!qcdm = Trim(txtqcdm.Text)
            .Fields!dw = Trim(txtdw.Text)
            .Fields!mc = Trim(txtdw.Text)
            .Fields!kcbz = Val(txtkcbz.Text)
            .Fields!kcsl = Val(txtkcsl.Text)
            .Update
        End With
    End If
    Unload Me
End Sub

⌨️ 快捷键说明

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