📄 frmwujie.frm
字号:
Height = 6015
Left = -74760
TabIndex = 3
Top = 480
Width = 9495
Begin MSDataGridLib.DataGrid DataGrid1
Height = 5895
Left = 0
TabIndex = 4
Top = 120
Width = 9495
_ExtentX = 16748
_ExtentY = 10398
_Version = 393216
AllowUpdate = 0 'False
BackColor = 8453888
HeadLines = 1
RowHeight = 14
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Label Label8
Caption = "审核"
Height = 375
Left = -69240
TabIndex = 19
Top = 840
Width = 615
End
Begin VB.Label Label7
Caption = "制单"
Height = 495
Left = -69240
TabIndex = 18
Top = 1560
Width = 855
End
Begin VB.Label Label6
Caption = "备注"
Height = 375
Left = -74400
TabIndex = 17
Top = 2160
Width = 735
End
Begin VB.Label Label5
Caption = "传真"
Height = 375
Left = -72000
TabIndex = 16
Top = 1560
Width = 735
End
Begin VB.Label Label4
Caption = "物洁排班"
Height = 375
Left = -72000
TabIndex = 15
Top = 840
Width = 1215
End
Begin VB.Label Label3
Caption = "联系人"
Height = 375
Left = -74400
TabIndex = 14
Top = 1560
Width = 855
End
Begin VB.Label Label2
Caption = "房间编号"
Height = 495
Left = -74400
TabIndex = 13
Top = 840
Width = 1095
End
End
End
Begin VB.Label Label1
Caption = "物洁排班管理"
BeginProperty Font
Name = "楷体_GB2312"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3360
TabIndex = 0
Top = 120
Width = 2895
End
End
Attribute VB_Name = "frmwujie"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Private Sub Form_Load()
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from 物洁排班管理", db, adOpenStatic, adLockOptimistic
Set DataGrid2.DataSource = adoPrimaryRS
Set Text1.DataSource = adoPrimaryRS
Set Text2.DataSource = adoPrimaryRS
Set Text3.DataSource = adoPrimaryRS
Set Text4.DataSource = adoPrimaryRS
Set Text5.DataSource = adoPrimaryRS
Set Text6.DataSource = adoPrimaryRS
Set Text7.DataSource = adoPrimaryRS
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.Enabled = True
Unload Me
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.AddNew
mbAddNewFlag = True
SetButtons False
End With
Exit Sub
AddErr:
MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
Dim Resp As Integer
Resp = MsgBox("你真的要删除该记录吗?", vbExclamation + vbOKCancel, pTitle)
If Resp = 2 Then
Exit Sub
Else
With adoPrimaryRS
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
End If
Exit Sub
DeleteErr:
MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdRefresh_Click()
'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:
MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdEdit_Click()
On Error GoTo EditErr
mbEditFlag = True
SetButtons False
Exit Sub
EditErr:
MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdCancel_Click()
' On Error Resume Next
On Error GoTo CancelErr
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark = mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
SetButtons True
Exit Sub
CancelErr:
MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
adoPrimaryRS.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
Exit Sub
UpdateErr:
MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdClose_Click()
frmmain.Enabled = True
Unload Me
End Sub
Private Sub SetButtons(bVal As Boolean)
Dim oText As TextBox
CmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
CmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
If bVal Then
Set DataGrid2.DataSource = adoPrimaryRS
Else
Set DataGrid2.DataSource = Nothing
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -