📄 frmgridparty.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.Form frmPartyModify
BorderStyle = 3 'Fixed Dialog
Caption = "学生党建信息全屏修改"
ClientHeight = 6540
ClientLeft = 45
ClientTop = 615
ClientWidth = 9510
Icon = "frmGridParty.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6540
ScaleWidth = 9510
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin MSDBGrid.DBGrid dbgrdStudent
Bindings = "frmGridParty.frx":030A
Height = 5955
Left = 30
OleObjectBlob = "frmGridParty.frx":031A
TabIndex = 0
Top = 60
Width = 9450
End
Begin ComctlLib.StatusBar SBar1
Align = 2 'Align Bottom
Height = 465
Left = 0
TabIndex = 2
Top = 6075
Width = 9510
_ExtentX = 16775
_ExtentY = 820
SimpleText = ""
_Version = 327682
BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
NumPanels = 1
BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
AutoSize = 1
Object.Width = 16722
Picture = "frmGridParty.frx":0CCD
Object.Tag = ""
EndProperty
EndProperty
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.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\Program Files\DevStudio\VB\学生数据库\Student.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 375
Left = 840
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ZBQKB"
Top = 2280
Visible = 0 'False
Width = 1455
End
Begin VB.CommandButton cmdExit
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 6900
TabIndex = 1
Top = 5130
Width = 1815
End
Begin VB.Line Line1
BorderColor = &H00000000&
X1 = 30
X2 = 2160
Y1 = 0
Y2 = 0
End
Begin VB.Menu MNUFILE
Caption = "【文件&F】"
Begin VB.Menu MNUEXIT
Caption = "退出[&X]"
End
End
Begin VB.Menu MNUCHA
Caption = "【功能切换&C】"
Begin VB.Menu MNUSQU
Caption = "记录查询[&S]"
End
Begin VB.Menu MNU21
Caption = "-"
End
Begin VB.Menu MNUCOUNT
Caption = "信息统计[&C]"
End
Begin VB.Menu MNU22
Caption = "-"
End
Begin VB.Menu MNUINPUT
Caption = "数据输入[&I]"
End
End
Begin VB.Menu MNULOC
Caption = "【定位&L】"
Begin VB.Menu MNUXH
Caption = "学号定位[&L]"
End
End
Begin VB.Menu MNUHELP
Caption = "【帮助&H】"
Begin VB.Menu MNUNOTE
Caption = "使用说明[&N]"
End
End
End
Attribute VB_Name = "frmPartyModify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim msSortCol As String
Dim mbCtrlKey As Integer
Dim I As Integer
Private Sub cmdExit_Click()
On Error Resume Next
Unload Me
'Frmstart.Show
End Sub
Private Sub dbgrdStudent_BeforeColUpdate(ByVal ColIndex As Integer, OldValue As Variant, Cancel As Integer)
On Error Resume Next
If MsgBox("您同意改变吗!", vbQuestion + vbOKCancel, "提示") = vbOK Then
Cancel = 0
Else
Cancel = 1
End If
End Sub
Private Sub dbgrdStudent_BeforeDelete(Cancel As Integer)
On Error Resume Next
If MsgBox("您同意删除吗!", vbQuestion + vbOKCancel, "提示") = vbOK Then
Cancel = 0
SBar1.Panels(1).Text = "共有" & I - 1 & "条记录!"
I = I - 1
Else
Cancel = 1
End If
End Sub
Private Sub dbgrdStudent_HeadClick(ByVal ColIndex As Integer)
If Data1.RecordsetType = vbRSTypeTable Then Exit Sub
If mbCtrlKey Then
msSortCol = Data1.Recordset(ColIndex).Name & " desc"
mbCtrlKey = 0
Else
msSortCol = Data1.Recordset(ColIndex).Name
End If
sort
msSortCol = gsNUL_STR
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim sqlForModify As String
Dim recForModify As Recordset
sqlForModify = "select xh as 学号,xm as 姓名,csny as 出生年月,mz as 民族,yx as 院系,nj as 年级,sy as 生源,xl as 学历,tgsj as 通过时间,zzsj as 转正时间,zdsj as 转档时间,zddd as 转档地点 from party"
Set recForModify = Dbstudent.OpenRecordset(sqlForModify, dbOpenDynaset)
Set Data1.Recordset = recForModify
Line1.X1 = 0
Line1.X2 = frmPartyModify.Width
recForModify.MoveLast
recForModify.MoveFirst
SBar1.Panels(1).Text = "共有" & recForModify.RecordCount & "条记录!" & " 【定位光标于某单元格内可进行修改,单击列头可以排序】"
I = recForModify.RecordCount
DBGrdstudent.Refresh
Data1.Refresh
DBGrdstudent.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Unload Me
End Sub
Private Sub MNUCOUNT_Click()
frmPartyCount.Show 1
End Sub
Private Sub MNUEXIT_Click()
On Error Resume Next
Unload Me
'Frmstart.Show
End Sub
Private Sub MNUINPUT_Click()
On Error Resume Next
frmPartyInput.Show 1
End Sub
Private Sub MNUNOTE_Click()
Dim TTT As String
Dim X
TTT = App.Path + "\help\djxg.txt"
X = Shell("Notepad " + TTT, 1)
End Sub
Private Sub MNUSQU_Click()
frmQueryParty.Show 1
End Sub
Private Sub MNUXH_Click()
On Error Resume Next
FRMDW.Label1.Caption = "党员学号定位"
FRMDW.Show 1
End Sub
Private Sub sort()
On Error GoTo sorterr
Dim recRecordset1 As Recordset, recRecordset2 As Recordset
Dim SortStr As String
Set recRecordset1 = Data1.Recordset 'copy the recordset
SortStr = msSortCol
recRecordset1.sort = SortStr
Set recRecordset2 = recRecordset1.OpenRecordset(recRecordset1.Type)
Set Data1.Recordset = recRecordset2
Screen.MousePointer = 0
Exit Sub
sorterr:
Screen.MousePointer = 0
On Error Resume Next
Exit Sub
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -