📄 frmsfbm.frm
字号:
VERSION 5.00
Begin VB.Form frmSfbm
BorderStyle = 3 'Fixed Dialog
Caption = "编码维护---省份编码"
ClientHeight = 2040
ClientLeft = 1095
ClientTop = 330
ClientWidth = 5775
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2040
ScaleWidth = 5775
StartUpPosition = 1 '所有者中心
Begin VB.ListBox ListHelpsfbm
BackColor = &H0080FFFF&
Height = 420
Left = 2160
TabIndex = 20
Top = 840
Visible = 0 'False
Width = 2415
End
Begin VB.Frame Frame1
Caption = "Frame1"
Enabled = 0 'False
Height = 1215
Left = 120
TabIndex = 16
Top = 120
Width = 5535
Begin VB.TextBox txtFields
DataField = "省份编码"
Height = 285
Index = 0
Left = 2040
TabIndex = 0
Top = 420
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "省份名称"
Height = 285
Index = 1
Left = 2040
TabIndex = 1
Top = 735
Width = 3375
End
Begin VB.Label lblLabels
Caption = "省份编码: **"
Height = 255
Index = 0
Left = 120
TabIndex = 19
Top = 420
Width = 1815
End
Begin VB.Label lblLabels
Caption = "省份名称: **"
Height = 255
Index = 1
Left = 120
TabIndex = 18
Top = 735
Width = 1815
End
Begin VB.Label Label1
Caption = "注意:带**号的字段不能为空,省份编码最多四位"
Height = 255
Left = 120
TabIndex = 17
Top = 0
Width = 4095
End
End
Begin VB.PictureBox picButtons
Align = 2 'Align Bottom
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 300
Left = 0
ScaleHeight = 300
ScaleWidth = 5775
TabIndex = 15
Top = 1440
Width = 5775
Begin VB.CommandButton cmdClose
Caption = "关闭(&C)"
Height = 300
Left = 4675
TabIndex = 6
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新(&R)"
Height = 300
Left = 3521
TabIndex = 5
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdEdit
Caption = "修改(&E)"
Height = 300
Left = 1213
TabIndex = 3
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdUpdate
Caption = "保存(&S)"
Height = 300
Left = 59
TabIndex = 11
Top = 0
Visible = 0 'False
Width = 1095
End
Begin VB.CommandButton cmdAdd
Caption = "添加(&A)"
Height = 300
Left = 59
TabIndex = 2
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "取消(&C)"
Height = 300
Left = 1213
TabIndex = 12
Top = 0
Visible = 0 'False
Width = 1095
End
Begin VB.CommandButton cmdQuery
Caption = "查询(&Q)"
Height = 300
Left = 2367
TabIndex = 4
Top = 0
Width = 1095
End
End
Begin VB.PictureBox picStatBox
Align = 2 'Align Bottom
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 300
Left = 0
ScaleHeight = 300
ScaleWidth = 5775
TabIndex = 13
Top = 1740
Width = 5775
Begin VB.CommandButton cmdLast
Height = 300
Left = 4545
Picture = "frmSfbm.frx":0000
Style = 1 'Graphical
TabIndex = 10
Top = 0
UseMaskColor = -1 'True
Width = 345
End
Begin VB.CommandButton cmdNext
Height = 300
Left = 4200
Picture = "frmSfbm.frx":0192
Style = 1 'Graphical
TabIndex = 9
Top = 0
UseMaskColor = -1 'True
Width = 345
End
Begin VB.CommandButton cmdPrevious
Height = 300
Left = 345
Picture = "frmSfbm.frx":0324
Style = 1 'Graphical
TabIndex = 8
Top = 0
UseMaskColor = -1 'True
Width = 345
End
Begin VB.CommandButton cmdFirst
Height = 300
Left = 0
Picture = "frmSfbm.frx":04B6
Style = 1 'Graphical
TabIndex = 7
Top = 0
UseMaskColor = -1 'True
Width = 345
End
Begin VB.Label lblStatus
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Height = 285
Left = 690
TabIndex = 14
Top = 0
Width = 3360
End
End
End
Attribute VB_Name = "frmSfbm"
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 mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean
'Dim NullWarnFlag As Boolean
Dim rsSFBM As Recordset
Dim rsSFBM1 As Recordset
'查询
Private Sub cmdQuery_Click()
Me.Hide
frmSfbmcx.Show
End Sub
'保证双击查询界面CELL切换到编码维护界面时当前记录的一致性
Private Sub Form_Activate()
If Me.Tag <> "" Then
adoPrimaryRS.MoveFirst
adoPrimaryRS.Find ("省份编码='" & Me.Tag & "'")
End If
End Sub
Private Sub Form_Click()
If Index = 0 Then ListHelpsfbm.Visible = False
End Sub
Private Sub Form_Load()
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select 省份编码,省份名称 from SFBM Order by 省份编码", dblgjx, adOpenStatic, adLockOptimistic
Set rsSFBM = New Recordset
rsSFBM.Open "select 省份编码,省份名称 from SFBM Order by 省份编码", dblgjx, adOpenStatic, adLockOptimistic
Set rsSFBM1 = New Recordset
rsSFBM1.Open "select 省份编码,省份名称 from SFBM Order by 省份编码", dblgjx, adOpenStatic, adLockOptimistic
Dim oText As TextBox
'绑定文本框到数据提供者
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
mbDataChanged = False
End Sub
Private Sub Form_Resize()
On Error Resume Next
lblStatus.Width = Me.Width - 1500
cmdNext.Left = lblStatus.Width + 700
cmdLast.Left = cmdNext.Left + 340
End Sub
'快捷键
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If mbEditFlag Or mbAddNewFlag Then Exit Sub
Select Case KeyCode
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -