📄 main_mima.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 = 2325
ClientLeft = 45
ClientTop = 435
ClientWidth = 4500
Icon = "main_mima.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2325
ScaleWidth = 4500
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 = 1590
MaxLength = 6
PasswordChar = "*"
TabIndex = 6
Top = 720
Width = 1920
End
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 1260
Left = 600
TabIndex = 2
Top = 2520
Visible = 0 'False
Width = 3015
Begin VB.Data Data2
Caption = "Data1"
Connect = "Access"
DatabaseName = "yyjxc.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ma"
Top = 600
Visible = 0 'False
Width = 1140
End
Begin VB.TextBox Text3
DataField = "密码"
DataSource = "Data1"
Height = 270
Left = 120
TabIndex = 4
Top = 240
Visible = 0 'False
Width = 1200
End
Begin VB.TextBox js
Height = 270
Left = 135
TabIndex = 3
Top = 630
Visible = 0 'False
Width = 1200
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "yyjxc.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ma"
Top = 240
Visible = 0 'False
Width = 1140
End
End
Begin VB.CommandButton comend
BackColor = &H00C0C0C0&
Height = 400
Left = 2115
Picture = "main_mima.frx":000C
Style = 1 'Graphical
TabIndex = 1
Top = 1245
Width = 1380
End
Begin VB.CommandButton Cmd1
BackColor = &H00C0C0C0&
Height = 400
Left = 735
MaskColor = &H00FF8080&
Picture = "main_mima.frx":19C6
Style = 1 'Graphical
TabIndex = 0
Top = 1245
UseMaskColor = -1 'True
Width = 1380
End
Begin MSDBCtls.DBCombo text1
Bindings = "main_mima.frx":3309
Height = 330
Left = 1590
TabIndex = 5
Top = 210
Width = 1920
_ExtentX = 3387
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "操作员"
Text = ""
End
Begin VB.Line Line1
X1 = 105
X2 = 4185
Y1 = 1875
Y2 = 1875
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "版权所有:CopyRight 2000-2010"
Height = 225
Left = 795
TabIndex = 9
Top = 1965
Width = 2805
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 = 720
TabIndex = 8
Top = 255
Width = 1095
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 = 720
TabIndex = 7
Top = 735
Width = 855
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 '定义一个整型变量
Dim MESSAGE As String '定义一个字符串变量
Private Sub Form_Activate()
'在标题栏上设置软件名称及版本
Me.Caption = App.Title & ":" & App.Major & "." & App.Minor & "." & App.Revision
'当记录为零时,进入系统具有所有权限
If Data1.Recordset.RecordCount = 0 Then
MsgBox ("您还没有设置操作员密码和权限,请设置操作员密码和权限!")
Load frm_main
frm_main.Show
Unload Me
Else
Text1.SetFocus 'text1获得焦点
End If
End Sub
Private Sub Form_Load()
TIM = 0 '为变量设初值
'自动识别数据库路径
Data1.DatabaseName = App.Path & "\yyjxc.mdb"
Data2.DatabaseName = App.Path & "\yyjxc.mdb"
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus '按回车键text2获得焦点
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 '按向上键text1获得焦点
End Sub
Private Sub cmd1_Click()
js.Text = TIM '赋值给js.text
'查询操作员信息
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 + -