📄 frmjkdj.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmjkdj
Caption = "借款登记"
ClientHeight = 2745
ClientLeft = 3945
ClientTop = 1875
ClientWidth = 4725
Icon = "frmjkdj.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 4725
Begin VB.Frame Frame1
Height = 2790
Left = 30
TabIndex = 0
Top = -60
Width = 4665
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 3465
Top = 1320
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3375
Top = 600
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 3735
TabIndex = 12
Top = 2355
Width = 840
End
Begin VB.CommandButton cmdok
Caption = "确 定"
Height = 375
Left = 2790
TabIndex = 11
Top = 2355
Width = 840
End
Begin VB.TextBox Text5
Height = 375
Left = 1425
TabIndex = 9
Top = 1860
Width = 585
End
Begin VB.TextBox Text4
Height = 375
Left = 165
TabIndex = 7
Top = 1860
Width = 885
End
Begin VB.TextBox Text3
Height = 375
Left = 1320
TabIndex = 6
Top = 1290
Width = 1695
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
TabIndex = 4
Top = 840
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 2
Top = 345
Width = 1695
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "元"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3135
TabIndex = 13
Top = 1410
Width = 210
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2145
TabIndex = 10
Top = 1950
Width = 210
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 1155
TabIndex = 8
Top = 1950
Width = 210
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "金 额:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 135
TabIndex = 5
Top = 1365
Width = 1050
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "姓 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 150
TabIndex = 3
Top = 915
Width = 1050
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "职工代号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 150
TabIndex = 1
Top = 420
Width = 1050
End
End
End
Attribute VB_Name = "frmjkdj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End Sub
Private Sub cmdok_Click()
On Error GoTo err1
Dim sql As String
If MsgBox("请确认日期是否正确,确认请按“是”,否则按“否”", vbYesNo + vbInformation, "提示") = vbNo Then
Exit Sub
End If
If IsNumeric(Text5.Text) = False Then
MsgBox "输入月份不是数字,请重输!", vbInformation, "提示"
Text5.Text = ""
Text5.SetFocus
Exit Sub
ElseIf Val(Trim(Text5.Text)) < 1 Or Val(Trim(Text5.Text)) > 12 Or Len(Trim(Text5.Text)) <> 2 Then
MsgBox "输入月份不正确,月份格式应为“06”形式,请重输!", vbInformation, "提示"
Text5.Text = ""
Text5.SetFocus
Exit Sub
End If
If IsNumeric(Text4.Text) = False Then
MsgBox "输入年份不是数字,请重输!", vbInformation, "提示"
Text4.Text = ""
Text4.SetFocus
Exit Sub
ElseIf Val(Trim(Text4.Text)) < 2000 Or Len(Trim(Text4.Text)) <> 4 Then
MsgBox "输入年份不正确,请重输!", vbInformation, "提示"
Text4.Text = ""
Text4.SetFocus
Exit Sub
End If
sql = "select * from grfpb where grdh='" & Trim(Text1.Text) & "'"
With Adodc1
If Text1.Text = "" Then
MsgBox "请输入借款人的代号!", vbInformation, "提示"
Exit Sub
ElseIf Text2.Text <> "" Then sql = sql & " and xm='" & Trim(Text2.Text) & "'"
End If
.ConnectionString = constr
.RecordSource = sql
.Refresh
If .Recordset.EOF And .Recordset.BOF Then
MsgBox "本公司没此人,不能借款,请仔细查询后再作决定。", vbExclamation, "提示"
Exit Sub
Else
cjdh = .Recordset.Fields("cjdh").Value
grdh = .Recordset.Fields("grdh").Value
xm = .Recordset.Fields("xm").Value
With Adodc2
.ConnectionString = constr
.RecordSource = "select * from jzb where grdh='" & Trim(Text1.Text) & "'"
.Refresh
If .Recordset.EOF And .Recordset.BOF Then
.Recordset.AddNew
.Recordset.Fields("cjdh").Value = cjdh
.Recordset.Fields("grdh").Value = grdh
.Recordset.Fields("xm").Value = xm
End If
If IsNull(.Recordset.Fields("ze").Value) Then
.Recordset.Fields("ze").Value = Val(Trim(Text3.Text))
Else
.Recordset.Fields("ze").Value = .Recordset.Fields("ze").Value + Val(Trim(Text3.Text))
End If
If IsNull(.Recordset.Fields("yf" & Trim(Text5.Text)).Value) Then
.Recordset.Fields("yf" & Trim(Text5.Text)).Value = Val(Trim(Text3.Text))
Else
.Recordset.Fields("yf" & Trim(Text5.Text)).Value = .Recordset.Fields("yf" & Trim(Text5.Text)).Value + Val(Trim(Text3.Text))
End If
.Recordset.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
MsgBox "完成!", vbInformation, "提示"
End With
End If
End With
Exit Sub
err1:
If Err.Number = -2147217887 Then
MsgBox "借款总额可能过大,请查阅借款表。", vbExclamation + vbOKOnly, "提示"
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim year1 As String
year1 = Now
v = Split(year1, "-")
Text4.Text = "20" & v(0)
If Len(v(1)) = 1 Then
Text5.Text = "0" & v(1)
Else
Text5.Text = v(1)
End If
End Sub
Private Sub Text3_LostFocus()
If IsNumeric(Text3.Text) = False And Text3.Text <> "" Then
MsgBox "请确认输入的是否是数字。", vbInformation, "提示"
Text3.SetFocus
Text3.Text = ""
Exit Sub
End If
If Text3.Text <> "" Then
If Len(Trim(Str$(Text3.Text))) > 6 Then
MsgBox "输入的数字过长,请重输。", vbInformation, "提示"
Text3.SetFocus
Text3.Text = ""
Exit Sub
End If
End If
End Sub
'Private Sub Text5_LostFocus()
'End Sub
'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -