?? frmfordjtzb.frm
字號:
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1230
TabIndex = 4
Text = " "
Top = 1350
Width = 1335
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "學號"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 150
TabIndex = 21
Top = 180
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "姓名"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 2670
TabIndex = 20
Top = 180
Width = 1095
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "院系"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 150
TabIndex = 19
Top = 795
Width = 1095
End
Begin VB.Label Label4
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "年級"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 2670
TabIndex = 18
Top = 795
Width = 1095
End
Begin VB.Label Label5
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "班級"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 150
TabIndex = 17
Top = 1410
Width = 1095
End
End
Begin VB.TextBox txtCL
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 1695
Left = 110
MultiLine = -1 'True
TabIndex = 7
Text = "frmForDJTZB.frx":18C0
Top = 2970
Width = 5415
End
Begin VB.Line Line2
BorderColor = &H00000000&
X1 = 0
X2 = 1170
Y1 = 0
Y2 = 0
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "入黨遞交書面材料管理:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 285
Left = 150
TabIndex = 15
Top = 2700
Width = 2415
End
Begin VB.Menu MNUFILE
Caption = "【文件&F】"
Begin VB.Menu MNUEXIT
Caption = "退出[&X]"
End
End
Begin VB.Menu MNULOC
Caption = "【記錄定位&L】"
Begin VB.Menu MNUXH
Caption = "學號定位[&L]"
End
End
Begin VB.Menu MNUPRINT
Caption = "【記錄打印&P】"
Begin VB.Menu MNUVIEW
Caption = "打印預覽[&V]"
End
End
Begin VB.Menu MNUHELP
Caption = "【幫助&H】"
Begin VB.Menu MNUNOTE
Caption = "使用說明[&N]"
End
End
End
Attribute VB_Name = "frmForDJTZB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public recForDJTZ As Recordset '瀏覽,刪除,修改時檢索用數據表
Public BookMark As Integer '數據表標志號
Public RecordCount As Integer '數據表記錄數
Public Modify As Boolean '是否處于修改狀態
Public AddNew As Boolean '是否處于添加狀態
Dim ex As Excel.Application
Dim exwbook As Excel.WorkBook
Dim exsheet As Excel.WorkSheet
Dim exchart As Excel.Chart
Dim I, J As Integer
Private Sub cboSB_KeyPress(KeyAscii As Integer)
On Error Resume Next
Dim sqlModify As String
Dim BookMarkSave As Integer
Dim I As Integer
If KeyAscii = 13 Then
If Modify Then
sqlModify = "update djtzb set sb='" + Trim(cboSB) + "' where id=" + Trim(recForDJTZ!ID) + ""
Dbstudent.Execute sqlModify
If MsgBox("保存對當條記錄的修改?", vbInformation + vbYesNo) = vbNo Then
Exit Sub
End If
cmdSave.Caption = "保存"
cmdSave.Enabled = False
BookMarkSave = BookMark
UpdateRecord
For I = 1 To BookMarkSave - 1
recForDJTZ.MoveNext
FillIn
Next I
BookMark = BookMarkSave
Modify = False
cmdModify.Enabled = True
cmdNext.Enabled = True
cmdPrevious.Enabled = True
End If
End If
End Sub
Private Sub cmdDelete_Click()
On Error Resume Next
Dim sqlForDelete As String
If txtXH = " " Then
MsgBox "無學號", vbInformation, "提示"
Else
If XHInDJTZB(txtXH) Then
If MsgBox("確信刪除?", vbQuestion + vbOKCancel) = vbOK Then
sqlForDelete = "delete * from djtzb where id=" + Trim(recForDJTZ!ID) + ""
Dbstudent.Execute sqlForDelete
InitItem
UpdateRecord
FillIn
End If
Else
MsgBox "記錄集中無此記錄!", vbInformation, "錯誤提示"
End If
End If
End Sub
Private Sub cmdExit_Click()
On Error Resume Next
Unload Me
End Sub
Private Sub cmdModify_Click()
On Error Resume Next
If txtXH = " " Then
MsgBox "無可用信息", vbInformation, "錯誤提示"
Exit Sub
Else
If XHInDJTZB(txtXH) Then
cmdSave.Enabled = True
cmdSave.Caption = "存儲"
Modify = True
cmdModify.Enabled = False
cmdNext.Enabled = False
cmdPrevious.Enabled = False
Else
MsgBox "基本庫中無此條記錄!", vbInformation, "提示"
Exit Sub
End If
End If
End Sub
Private Sub cmdNew_Click()
On Error Resume Next
InitItem
AddNew = True
txtXH.SetFocus
End Sub
Private Sub cmdNext_Click()
On Error Resume Next
If recForDJTZ.RecordCount = 0 Then
MsgBox "表中無記錄", vbInformation, "提示"
Exit Sub
End If
If BookMark = recForDJTZ.RecordCount Then
MsgBox "這是最后一條記錄!", vbInformation, "提示"
FillIn
Else
BookMark = BookMark + 1
recForDJTZ.MoveNext
FillIn
End If
End Sub
Private Sub cmdPrevious_Click()
On Error Resume Next
If recForDJTZ.RecordCount = 0 Then
MsgBox "表中無記錄!", vbInformation, "提示"
Exit Sub
End If
If BookMark = 1 Then
MsgBox "這是首條記錄!", vbInformation, "提示"
FillIn
Else
BookMark = BookMark - 1
recForDJTZ.MovePrevious
FillIn
End If
End Sub
Private Sub cmdSave_Click()
Dim sqlForInsert As String
On Error Resume Next
If cmdSave.Caption = "存儲" Then
cmdSave.Enabled = False
cmdSave.Caption = "保存"
UpdateRecord
cmdModify.Enabled = True
AddNew = False
cmdNext.Enabled = True
cmdPrevious.Enabled = True
Exit Sub
End If
If CheckItem = True Then
sqlForInsert = "insert into djtzb(xh,xm,bj,yx,nj,sb,sxsj,cl) "
sqlForInsert = sqlForInsert + "values('" + Trim(txtXH) + "','" + Trim(txtXM) + "',"
sqlForInsert = sqlForInsert + "'" + Trim(txtBJ) + "','" + Trim(txtYX) + "',"
sqlForInsert = sqlForInsert + "'" + Trim(txtNJ) + "','" + Trim(cboSB) + "',"
sqlForInsert = sqlForInsert + "'" + Trim(CDate(mskSXSJ)) + "','" + Trim(txtCL) + "')"
Dbstudent.Execute sqlForInsert
If MsgBox("繼續添加?", vbQuestion + vbYesNo) = vbYes Then
InitItem
txtXH.SetFocus
Exit Sub
End If
cmdSave.Enabled = False
UpdateRecord
cmdModify.Enabled = True
AddNew = False
cmdNext.Enabled = True
cmdPrevious.Enabled = True
InitItem
FillIn
txtXH.SetFocus
Else
MsgBox "時間輸入有誤!", vbCritical, "錯誤提示"
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
UpdateRecord
Modify = False
cmdSave.Enabled = False
AddNew = False
With cboSB
.AddItem "黨員"
.AddItem "入黨積極分子"
End With
If RecordCount <> 0 Then
FillIn
End If
Line2.X1 = 0
Line2.X2 = frmForDJTZB.Width
End Sub
'顯示當前記錄
Public Sub FillIn()
On Error Resume Next
Dim Year0 As String
Dim Month0 As String
Dim Day0 As String
If recForDJTZ.RecordCount = 0 Then
MsgBox "無當前數據!", vbInformation, "提示"
Exit Sub
End If
If Not IsNull(recForDJTZ!XH) Then txtXH = recForDJTZ!XH
If Not IsNull(recForDJTZ!XM) Then txtXM = recForDJTZ!XM
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -