📄 frmysk.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmysk
BackColor = &H00A56E3A&
Caption = "应收款登记查询"
ClientHeight = 6255
ClientLeft = 60
ClientTop = 345
ClientWidth = 7935
Icon = "frmysk.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6255
ScaleWidth = 7935
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
BackColor = &H0080FF80&
Caption = "退出"
Height = 330
Left = 2895
Style = 1 'Graphical
TabIndex = 13
Top = 1365
Width = 945
End
Begin VB.CommandButton Command2
BackColor = &H0080FF80&
Caption = "删除"
Height = 330
Left = 1770
Style = 1 'Graphical
TabIndex = 12
Top = 1365
Width = 945
End
Begin VB.CommandButton Command1
BackColor = &H0080FF80&
Caption = "保存"
Height = 330
Left = 645
Style = 1 'Graphical
TabIndex = 11
Top = 1365
Width = 945
End
Begin VB.TextBox Text3
Height = 330
Left = 4335
TabIndex = 10
Text = "Text3"
Top = 690
Width = 1965
End
Begin VB.TextBox Text2
Height = 330
Left = 750
TabIndex = 8
Text = "Text2"
Top = 660
Width = 3030
End
Begin VB.TextBox Text1
Height = 330
Left = 5595
TabIndex = 6
Text = "Text1"
Top = 300
Width = 2130
End
Begin MSComCtl2.DTPicker d1
Height = 300
Left = 765
TabIndex = 4
Top = 300
Width = 1260
_ExtentX = 2223
_ExtentY = 529
_Version = 393216
Format = 24379393
CurrentDate = 37678
End
Begin VB.ComboBox Combo1
Height = 300
Left = 3105
TabIndex = 2
Text = "Combo1"
Top = 315
Width = 2025
End
Begin MSFlexGridLib.MSFlexGrid ysk
Height = 4140
Left = 195
TabIndex = 0
Top = 1965
Width = 7575
_ExtentX = 13361
_ExtentY = 7303
_Version = 393216
FixedCols = 0
SelectionMode = 1
End
Begin VB.Line Line1
BorderColor = &H8000000D&
Index = 1
X1 = 285
X2 = 7755
Y1 = 1245
Y2 = 1245
End
Begin VB.Line Line1
BorderColor = &H8000000B&
Index = 0
X1 = 300
X2 = 7770
Y1 = 1260
Y2 = 1260
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "金额"
ForeColor = &H8000000E&
Height = 285
Index = 4
Left = 3855
TabIndex = 9
Top = 765
Width = 495
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "摘要"
ForeColor = &H8000000E&
Height = 285
Index = 3
Left = 330
TabIndex = 7
Top = 735
Width = 420
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "编号"
ForeColor = &H8000000E&
Height = 285
Index = 2
Left = 5205
TabIndex = 5
Top = 390
Width = 555
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "日期"
ForeColor = &H8000000E&
Height = 240
Index = 1
Left = 330
TabIndex = 3
Top = 360
Width = 555
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单位/个人"
ForeColor = &H8000000E&
Height = 285
Index = 0
Left = 2205
TabIndex = 1
Top = 360
Width = 915
End
End
Attribute VB_Name = "frmysk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Setnull()
Dim s1 As String
d1.Value = Date
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Clear
s1 = "select xm from jzdw"
Set Rs1 = GetRsBySQL(s1)
Do While Not Rs1.EOF
Combo1.AddItem Trim(Rs1!Xm)
Rs1.MoveNext
Loop
Rs1.Close
End Sub
Private Sub Command1_Click()
Dim s1 As String
s1 = "select * from ys_1 where ys_bh='" & Trim(Text1.Text) & "'"
If Combo1.Text = "" Or Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "项目不能为空!!!!", , "提示"
Exit Sub
End If
Set Rs1 = GetRsBySQL(s1)
If Not Rs1.EOF Then
MsgBox "对不起,编号不能重复!", , "提示"
Text1.SetFocus
Rs1.Close
Exit Sub
Else
s1 = "insert into ys_1 (ys_bh,ys_date,ys_dw,ys_zy,ys_je) values ('" & Trim(Text1.Text) & "','" & Format(d1.Value, "yyyy-mm-dd") & "','" & Trim(Combo1.Text) & "','" & Trim(Text2.Text) & "'," & Val(Text3.Text) & ")"
Call ExeSQLByCmd(s1)
MsgBox "保存成功!", , "提示"
Call Initysk
Call Setnull
End If
End Sub
Private Sub Command2_Click()
Dim s1 As String
s1 = "delete from ys_1 where ys_bh='" & ysk.Text & "'"
Call ExeSQLByCmd(s1)
Call Initysk
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call Setnull
Call Initysk
End Sub
Private Sub Initysk()
On Error Resume Next
Dim rs As ADODB.Recordset
Dim i As Long
strsql = "select * from ys_1"
Set rs = GetRsBySQL(strsql)
With ysk
.Rows = rs.RecordCount + 1
.Cols = 5
.TextMatrix(0, 0) = "编号"
.TextMatrix(0, 1) = "名称"
.TextMatrix(0, 2) = "日期"
.TextMatrix(0, 3) = "摘要"
.TextMatrix(0, 4) = "金额"
.ColWidth(1) = 1200
.ColWidth(3) = 1200
For i = 0 To rs.RecordCount - 1
.TextMatrix(i + 1, 0) = rs("ys_bh")
.TextMatrix(i + 1, 1) = rs("ys_dw")
.TextMatrix(i + 1, 2) = rs("ys_date")
.TextMatrix(i + 1, 3) = rs("ys_zy")
.TextMatrix(i + 1, 4) = Format(rs("ys_je"), "###0.00")
rs.MoveNext
Next
End With
rs.Close
Set rs = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -