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

📄 frmcheckstoreedit.frm

📁 vb与access数据库的操作实例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmCheckStoreEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑图书盘点信息"
   ClientHeight    =   3615
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6555
   Icon            =   "FrmCheckStoreEdit.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3615
   ScaleWidth      =   6555
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame2 
      Caption         =   "图书信息"
      Height          =   1335
      Left            =   120
      TabIndex        =   9
      Top             =   120
      Width           =   6255
      Begin VB.TextBox txtBookNo 
         Enabled         =   0   'False
         Height          =   330
         Left            =   1080
         TabIndex        =   13
         Top             =   300
         Width           =   2055
      End
      Begin VB.CommandButton Cmd_SelBook 
         Caption         =   "选择图书"
         Height          =   400
         Left            =   5040
         TabIndex        =   12
         Top             =   240
         Width           =   975
      End
      Begin VB.TextBox txtBookName 
         Enabled         =   0   'False
         Height          =   330
         Left            =   1080
         TabIndex        =   11
         Top             =   760
         Width           =   2055
      End
      Begin VB.TextBox txtTotal 
         Enabled         =   0   'False
         Height          =   330
         Left            =   4440
         TabIndex        =   10
         Top             =   760
         Width           =   1575
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "书    号"
         Height          =   180
         Left            =   240
         TabIndex        =   16
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "图书名称"
         Height          =   180
         Left            =   240
         TabIndex        =   15
         Top             =   840
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "当前库存"
         Height          =   180
         Left            =   3480
         TabIndex        =   14
         Top             =   840
         Width           =   720
      End
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   1547
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3000
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   3707
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   3000
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      Height          =   1215
      Left            =   120
      TabIndex        =   4
      Top             =   1560
      Width           =   6255
      Begin VB.TextBox txtCreateDate 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   4440
         MaxLength       =   20
         TabIndex        =   6
         Top             =   720
         Width           =   1575
      End
      Begin VB.TextBox txtUserName 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1560
         MaxLength       =   20
         TabIndex        =   1
         Top             =   720
         Width           =   1575
      End
      Begin VB.TextBox txtRealCount 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1560
         MaxLength       =   100
         TabIndex        =   0
         Text            =   "0"
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "库存盘点数量"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   240
         TabIndex        =   8
         Top             =   360
         Width           =   1080
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "盘点日期"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   3480
         TabIndex        =   7
         Top             =   795
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "盘 点 人"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   600
         TabIndex        =   5
         Top             =   795
         Width           =   720
      End
   End
End
Attribute VB_Name = "FrmCheckStoreEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public OriId As Long   '盘点编号

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  '检查用户录入数据的有效性
  If Len(Trim(txtBookNo)) = 0 Then
    MsgBox "请输入图书编号"
    Cmd_SelBook.SetFocus
    Exit Sub
  End If
  If Len(Trim(txtRealCount)) < 0 Then
    MsgBox "请输入库存盘点数量"
    txtRealCount.SetFocus
    txtRealCount.SelStart = 0
    txtRealCount.SelLength = Len(txtRealCount)
    Exit Sub
  End If
  '把用户录入的数据赋值到MyBook对象变量中
  With MyCheckStore
    .BookNo = MakeStr(txtBookNo)
    .OrgCount = Val(txtTotal)
    .RealCount = MakeStr(txtRealCount)
    .UserName = MakeStr(txtUserName)
    .CreateDate = MakeStr(txtCreateDate)
    If Modify = False Then
      '插入数据库
      .Insert
    Else
      .Update (OriId)
    End If
  End With
  '关闭窗口
  Unload Me
End Sub

Private Sub Cmd_SelBook_Click()
  '选择图书
  FrmBookSel.Show 1
  txtBookNo = Trim(SelBookInfo.BookNo)
  txtBookName = Trim(SelBookInfo.BookName)
  txtTotal = Val(SelBookInfo.Total)
End Sub

⌨️ 快捷键说明

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