📄 zyxx.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form zyxx
Caption = "职员信息"
ClientHeight = 9660
ClientLeft = 1800
ClientTop = 2100
ClientWidth = 14970
Icon = "zyxx.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 9660
ScaleWidth = 14970
WindowState = 2 'Maximized
Begin VB.CommandButton Command1
Caption = "退出(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 4
Left = 10920
TabIndex = 7
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "打印(&P)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 3
Left = 8880
TabIndex = 6
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "删除(&D)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 6840
TabIndex = 5
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "修改(&X)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 4920
TabIndex = 4
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添加(&A)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 3120
TabIndex = 3
Top = 8880
Width = 1095
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 4200
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "zyzl"
Top = 1320
Visible = 0 'False
Width = 2295
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 2
Top = 9165
Width = 14970
_ExtentX = 26405
_ExtentY = 873
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 15637
MinWidth = 5080
Text = "单击表格头可选中整行或整列 "
TextSave = "单击表格头可选中整行或整列 "
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 3528
MinWidth = 3528
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 6632
MinWidth = 6632
EndProperty
EndProperty
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid
Bindings = "zyxx.frx":0442
Height = 8175
Left = 240
TabIndex = 0
Top = 360
Width = 14775
_ExtentX = 26061
_ExtentY = 14420
_Version = 393216
Rows = 20
Cols = 7
BackColor = -2147483624
ForeColor = -2147483642
ForeColorFixed = 0
BackColorSel = 64
ForeColorSel = 16777215
BackColorBkg = 16777215
FocusRect = 2
GridLines = 3
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Frame Frame1
Height = 8535
Left = 120
TabIndex = 1
Top = 120
Width = 15100
End
End
Attribute VB_Name = "zyxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public dj As Integer
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 4
Unload Me
Case 0
tjzy.Show
Case 1
If dj = 1 Then
c = zyxx.MSFlexGrid.Row
strfind = zyxx.MSFlexGrid.TextMatrix(c, 1)
If strfind = "0001w" Then
MsgBox "系统管理员不可修改.", vbInformation, "提示"
Exit Sub
End If
On Error GoTo endthis
zyxx.Data1.Recordset.FindFirst "zybh = " & "'" & strfind & "'"
xgzyxx.Show
Else
MsgBox "请先选好要修改的职员", vbInformation, "提示"
End If
Case 2
c = zyxx.MSFlexGrid.Row
strfind = zyxx.MSFlexGrid.TextMatrix(c, 1)
If strfind = "0001w" Then
MsgBox "系统管理员不可删除.", vbInformation, "提示"
Exit Sub
End If
On Error GoTo endthis
If dj = 1 Then
zyxx.Data1.Recordset.FindFirst "zybh = " & "'" & strfind & "'"
'****************************************************
Msg = "确实要删除此记录吗?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "提示" ' 定义标题。
Ctxt = 1000 ' 定义标题
' 上下文。
' 显示信息。
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' 用户按下“是”。
MyString = "Yes" ' 完成某操作。
'czrygl.Data1.Recordset.MoveNext
'On Error GoTo endthis
zyxx.Data1.Recordset.Delete
zyxx.Data1.Refresh
zyxx.Hide
Call Form_Activate
zyxx.Show
Else ' 用户按下“否”。
MyString = "No" ' 完成某操作。
End If
'****************************************************
Else
MsgBox "请先选好要删除的商品。", vbInformation, "提示"
End If
endthis:
Exit Sub
Case 3
zyxxrpt.Show
End Select
End Sub
Private Sub Command2_Click()
'Debug.Print Data1.Recordset.Fields(0).Name
End Sub
Private Sub Form_Activate()
MSFlexGrid.TextMatrix(0, 1) = "职员编号"
MSFlexGrid.TextMatrix(0, 2) = "姓名"
MSFlexGrid.TextMatrix(0, 3) = "性别"
MSFlexGrid.TextMatrix(0, 4) = "联系方式"
MSFlexGrid.TextMatrix(0, 5) = "所在部门"
MSFlexGrid.TextMatrix(0, 6) = "备注"
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(3) = 800
MSFlexGrid.ColWidth(4) = 1800
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from zyzl"
'MSFlexGrid.FormatString = " 职员编号; 姓名"
'MSFlexGrid.TextMatrix(0, 1) = "职员"
'Debug.Print Data1.Recordset.Fields(0).Name
'Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;DataSource=" & App.Path & "\db1.mdb"
'Adodc1.CommandType = adCmdTable
'Adodc1.RecordSource = "select * from zyzl"
'Adodc1.Refresh
'Data1.DatabaseName = App.Path & "\db1.mdb"
'Set DataGrid1.DataSource = Adodc1
' Set MSFlexGrid.DataSource = Data1
'Set Text1.DataSource = Data1
End Sub
Private Sub MSFlexGrid_Click()
dj = 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -