📄 frmsanitation.frm
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SMARTXPBUTTON.OCX"
Begin VB.Form FrmSanitation
BackColor = &H00E0E0E0&
BorderStyle = 3 'Fixed Dialog
Caption = "修改卫生费用"
ClientHeight = 2910
ClientLeft = 30
ClientTop = 315
ClientWidth = 4710
Icon = "FrmSanitation.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2910
ScaleWidth = 4710
StartUpPosition = 2 '屏幕中心
Begin SmartXPButton.XpButton Command1
Height = 435
Index = 0
Left = 2550
TabIndex = 4
TabStop = 0 'False
Top = 2175
Width = 1335
_ExtentX = 2355
_ExtentY = 767
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出(&X)"
PictureSmoothBackColor= 13882323
ButtonPicture = "FrmSanitation.frx":030A
End
Begin SmartXPButton.XpButton Command1
Height = 435
Index = 2
Left = 750
TabIndex = 3
TabStop = 0 'False
Top = 2175
Width = 1635
_ExtentX = 2884
_ExtentY = 767
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "保存修改(&C)"
PictureSmoothBackColor= 13882323
ButtonPicture = "FrmSanitation.frx":0464
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 0
Left = 1005
Locked = -1 'True
TabIndex = 0
TabStop = 0 'False
Text = "0"
ToolTipText = "号数不能为空"
Top = 690
Width = 3165
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 1
Left = 1005
Locked = -1 'True
TabIndex = 1
TabStop = 0 'False
Text = "1"
Top = 1095
Width = 3165
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H00DFFFF8&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Index = 2
Left = 1005
ScrollBars = 2 'Vertical
TabIndex = 2
Text = "2"
ToolTipText = "户主不能为空"
Top = 1500
Width = 3165
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Label2"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 315
Left = 75
TabIndex = 8
Top = 150
Width = 4620
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "号数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 0
Left = 450
TabIndex = 7
Top = 735
Width = 630
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "金额:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 1
Left = 450
TabIndex = 6
Top = 1560
Width = 630
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "户名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 7
Left = 450
TabIndex = 5
Top = 1140
Width = 630
End
End
Attribute VB_Name = "FrmSanitation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Public Pid As Integer
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then Unload Me
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
For i = 0 To 2
Text1(i).Text = ""
Next i
End Sub
Private Sub Text1_GotFocus(Index As Integer)
If Index = 0 Then
Text1(Index).SelStart = Len(Text1(Index).Text)
Exit Sub
End If
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index).Text)
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0: Exit Sub
Select Case Index
Case 2
If KeyAscii <= vbKey9 And KeyAscii >= 46 Or KeyAscii = vbKeyBack Then Exit Sub
KeyAscii = 0
End Select
End Sub
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0 '退出
Unload Me
Case 2 '修改
If Val(Text1(2).Text) = 0 Then
Unload Me
Exit Sub
End If
Dim Rec As New ADODB.Recordset
Set Rec = Cn_Rsh.Execute("select * from lqsanitation where id=" & Pid & " and year=" & MdlMain.OpenType)
If Rec.EOF And Rec.BOF Then
Cn_Rsh.Execute "insert into lqsanitation([id],[year],[money]) values(" & _
Pid & "," & MdlMain.OpenType & "," & _
Val(Text1(2).Text) & ")"
Else
Cn_Rsh.Execute "update lqsanitation set [money]=" & Val(Text1(2).Text) & _
" where id=" & Pid & " and year=" & MdlMain.OpenType
End If
FrmMain.ListView1.SelectedItem.SubItems(3) = Val(Text1(2).Text)
Rec.Close: Set Rec = Nothing
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -