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

📄 main_mima.frm

📁 珠宝为例
💻 FRM
字号:
VERSION 5.00
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form main_mima 
   BackColor       =   &H00808080&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "珠宝首饰进销存管理系统"
   ClientHeight    =   2415
   ClientLeft      =   3240
   ClientTop       =   4230
   ClientWidth     =   5040
   Icon            =   "main_mima.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "main_mima.frx":000C
   ScaleHeight     =   2415
   ScaleWidth      =   5040
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame1 
      Caption         =   "Frame1"
      Height          =   1020
      Left            =   -2610
      TabIndex        =   5
      Top             =   615
      Visible         =   0   'False
      Width           =   2730
      Begin VB.TextBox Text3 
         DataField       =   "密码"
         DataSource      =   "Data1"
         Height          =   270
         Left            =   1395
         TabIndex        =   8
         Top             =   525
         Visible         =   0   'False
         Width           =   1200
      End
      Begin VB.Data Data2 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   "D:\VB数据库开发实例解析\程序\珠宝首饰进销存管理系统\zbjxc.mdb"
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   345
         Left            =   555
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "ma"
         Top             =   135
         Visible         =   0   'False
         Width           =   1140
      End
      Begin VB.TextBox js 
         Height          =   270
         Left            =   150
         TabIndex        =   6
         Top             =   540
         Visible         =   0   'False
         Width           =   1200
      End
      Begin VB.Data Data1 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   "D:\行业管理软件之一\腾龙珠宝首饰进销存管理系统\zbjxc.mdb"
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   345
         Left            =   45
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "ma"
         Top             =   195
         Visible         =   0   'False
         Width           =   1140
      End
   End
   Begin MSDBCtls.DBCombo text1 
      Bindings        =   "main_mima.frx":3E88A
      Height          =   330
      Left            =   1950
      TabIndex        =   7
      Top             =   420
      Width           =   1920
      _ExtentX        =   3387
      _ExtentY        =   582
      _Version        =   393216
      Style           =   2
      ListField       =   "操作员"
      Text            =   ""
   End
   Begin VB.CommandButton comend 
      BackColor       =   &H00C0C0C0&
      Height          =   400
      Left            =   2505
      Picture         =   "main_mima.frx":3E89E
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1650
      Width           =   1380
   End
   Begin VB.CommandButton Cmd1 
      BackColor       =   &H00C0C0C0&
      Height          =   400
      Left            =   1125
      MaskColor       =   &H00FF8080&
      Picture         =   "main_mima.frx":40258
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1650
      UseMaskColor    =   -1  'True
      Width           =   1380
   End
   Begin VB.TextBox Text2 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      IMEMode         =   3  'DISABLE
      Left            =   1950
      MaxLength       =   6
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   915
      Width           =   1920
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "密  码:         "
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1095
      TabIndex        =   4
      Top             =   945
      Width           =   975
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "操作员:"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   1095
      TabIndex        =   3
      Top             =   465
      Width           =   1095
   End
End
Attribute VB_Name = "main_mima"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TIM As Integer
Private Sub Form_Activate()
 Me.Caption = App.Title & "    版本: V" & App.Major & "." & App.Minor & "." & App.Revision
 TIM = 0
 Text1.SetFocus
End Sub
Private Sub Form_Load()
  '自动识别数据库路径
  Data1.DatabaseName = App.Path & "\zbjxc.mdb"
  Data2.DatabaseName = App.Path & "\zbjxc.mdb"
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus
End Sub
Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
'回车获得焦点
  If KeyCode = vbKeyReturn Then
     Cmd1.Visible = True
     Cmd1.SetFocus
  End If
  If KeyCode = vbKeyUp Then Text1.SetFocus
End Sub
Private Sub cmd1_Click()
  Dim MESSAGE As String
  js.Text = TIM
  '查询操作员信息
  Data1.RecordSource = "select * from ma where 操作员='" & Text1.Text & "'"
  Data1.Refresh
  If Text1.Text <> "" And Text2.Text = Text3.Text Then
     Load frm_main
     frm_main.Show
     Unload Me
   Else
     If TIM = 3 Then
        MESSAGE = MsgBox("密码输入错误,请向系统管理员查询!", 0, "")
        If MESSAGE = vbOK Then End
     End If
     If Text1.Text = "" Then
        MsgBox ("请输入操作员代号!")
        Text1.SetFocus
      Else
        If Text1.Text <> Data1.Recordset.Fields("操作员") Then
           MsgBox ("查无此操作员,请重新输入操作员代号!")
           Text1.SetFocus
         Else
           If Text2.Text <> Text3.Text Then
             MsgBox ("密码错误,请重新输入密码!")
             TIM = TIM + 1
             Text2.SetFocus
           End If
        End If
     End If
  End If
End Sub
Private Sub Comend_Click()
  End
End Sub

⌨️ 快捷键说明

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