📄 frmhtxxqk.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form FrmHTXXQK
BackColor = &H80000018&
BorderStyle = 1 'Fixed Single
Caption = "合同详细情况"
ClientHeight = 4470
ClientLeft = 45
ClientTop = 330
ClientWidth = 6450
Icon = "FrmHTXXQK.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4470
ScaleWidth = 6450
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtHTNum
Height = 345
Left = 1155
TabIndex = 5
Top = 180
Width = 1965
End
Begin VB.TextBox txtHTJE
Height = 345
Left = 4335
TabIndex = 4
Top = 180
Width = 1695
End
Begin VB.TextBox txtHTFKQK
Height = 2385
Left = 1155
MultiLine = -1 'True
TabIndex = 1
Top = 1140
Width = 5085
End
Begin XPControls.XPCommandButton cmdOK
Height = 465
Left = 1365
TabIndex = 0
Top = 3750
Width = 1245
_ExtentX = 2196
_ExtentY = 820
Caption = "确定"
BeginProperty Font {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
End
Begin MSComCtl2.DTPicker dtpEndTime
Height = 345
Left = 4305
TabIndex = 2
Top = 660
Width = 1725
_ExtentX = 3043
_ExtentY = 609
_Version = 393216
Format = 231145473
CurrentDate = 38110
MaxDate = 73415
MinDate = 36526
End
Begin MSComCtl2.DTPicker dtpStartTime
Height = 345
Left = 1155
TabIndex = 3
Top = 660
Width = 1995
_ExtentX = 3519
_ExtentY = 609
_Version = 393216
Format = 231145473
CurrentDate = 38110
MaxDate = 73415
MinDate = 36526
End
Begin XPControls.XPCommandButton cmdCancel
Height = 465
Left = 3795
TabIndex = 6
Top = 3750
Width = 1245
_ExtentX = 2196
_ExtentY = 820
Caption = "取消"
BeginProperty Font {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
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "合同号:"
Height = 315
Left = 90
TabIndex = 12
Top = 240
Width = 1005
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "合同金额:"
Height = 315
Left = 3315
TabIndex = 11
Top = 240
Width = 1005
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "起始时间:"
Height = 315
Left = 90
TabIndex = 10
Top = 720
Width = 1005
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "元"
Height = 315
Left = 5925
TabIndex = 9
Top = 240
Width = 345
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "结束时间:"
Height = 315
Left = 3315
TabIndex = 8
Top = 720
Width = 1005
End
Begin VB.Label Label6
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "付款情况:"
Height = 315
Left = 90
TabIndex = 7
Top = 1200
Width = 1005
End
End
Attribute VB_Name = "FrmHTXXQK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim rsTemp As ADODB.Recordset
Dim cmdTemp As ADODB.Command
Dim strSQL As String
If txtHTNum.Text = "" Then
MsgBox "请输入合同号", , "提示"
Exit Sub
End If
'检查是否有重复的合同号
If gHTOperation = Add Then
Set rsTemp = New ADODB.Recordset
rsTemp.Open "select count(*) from SET_DW_HT where HTNum='" & txtHTNum.Text & "'", GCon, adOpenStatic, adLockReadOnly
If rsTemp(0) > 0 Then
MsgBox "请检查合同号,与现有的重复", , "提示"
Exit Sub
End If
End If
gHT.HTNum = txtHTNum.Text
gHT.HTStartTime = dtpStartTime.Value
gHT.HTEndTime = dtpEndTime.Value
gHT.HTJE = txtHTJE.Text
gHT.HTFKQK = txtHTFKQK.Text
Set cmdTemp = New ADODB.Command
Set cmdTemp.ActiveConnection = GCon
If gHTOperation = Modify Then
strSQL = "update SET_DW_HT set " _
& "HTStartTime='" & gHT.HTStartTime & "'" _
& ",HTEndTime='" & gHT.HTEndTime & "'" _
& ",HTJE=" & gHT.HTJE _
& ",HTFKQK='" & gHT.HTFKQK & "'" _
& " where HTNum='" & txtHTNum.Text & "'"
cmdTemp.CommandText = strSQL
cmdTemp.Execute
Unload Me
ElseIf gHTOperation = Add Then
strSQL = "insert SET_DW_HT(DWID,HTNum) values('" & FrmKHGL.lvwDW.SelectedItem & "','" & txtHTNum.Text & "')"
cmdTemp.CommandText = strSQL
cmdTemp.Execute
strSQL = "update SET_DW_HT set " _
& "HTStartTime='" & gHT.HTStartTime & "'" _
& ",HTEndTime='" & gHT.HTEndTime & "'" _
& ",HTJE=" & gHT.HTJE _
& ",HTFKQK='" & gHT.HTFKQK & "'" _
& " where HTNum='" & txtHTNum.Text & "'"
cmdTemp.CommandText = strSQL
cmdTemp.Execute
Unload Me
End If
FrmKHGL.RefreshHT
End Sub
Private Sub Form_Load()
If gHTOperation = Modify Then
txtHTNum.Text = gHT.HTNum
txtHTNum.Locked = True
dtpStartTime.Value = gHT.HTStartTime
dtpEndTime.Value = gHT.HTEndTime
txtHTJE.Text = gHT.HTJE
txtHTFKQK.Text = gHT.HTFKQK
End If
End Sub
Private Sub txtHTJE_KeyPress(KeyAscii As Integer)
'不是回车和退格键的时候,校验长度和字符
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
'是否输入了数字
If ((KeyAscii < vbKey0) Or (KeyAscii > vbKey9)) And KeyAscii <> 46 Then
Beep 50, 10
KeyAscii = 0
End If
End If
If KeyAscii = vbKeyReturn Then
EnterToTab KeyAscii
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -