📄 form1.frm
字号:
Width = 2535
Begin VB.TextBox Text7
Appearance = 0 'Flat
DataField = "ldzj"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 10
TabIndex = 5
Top = 645
Width = 1335
End
Begin VB.TextBox Text8
Appearance = 0 'Flat
DataField = "jc"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 10
TabIndex = 6
Top = 1035
Width = 1335
End
Begin VB.TextBox Text9
Appearance = 0 'Flat
DataField = "jr"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 10
TabIndex = 11
Top = 1395
Width = 1335
End
Begin VB.TextBox Text6
Appearance = 0 'Flat
DataField = "cq"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 10
TabIndex = 4
Top = 240
Width = 1320
End
Begin VB.Label Label22
AutoSize = -1 'True
Caption = "元"
Height = 180
Left = 2280
TabIndex = 33
Top = 1440
Width = 180
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "元"
Height = 180
Left = 2280
TabIndex = 32
Top = 1080
Width = 180
End
Begin VB.Label Label20
AutoSize = -1 'True
Caption = "元"
Height = 180
Left = 2280
TabIndex = 31
Top = 690
Width = 180
End
Begin VB.Label Label19
AutoSize = -1 'True
Caption = "元"
Height = 180
Left = 2280
TabIndex = 30
Top = 285
Width = 180
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "活动资金"
Height = 180
Left = 120
TabIndex = 20
Top = 690
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "借出金额"
Height = 180
Left = 120
TabIndex = 19
Top = 1080
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "借入金额"
Height = 180
Left = 120
TabIndex = 18
Top = 1440
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "存款金额"
Height = 180
Left = 120
TabIndex = 17
Top = 285
Width = 720
End
End
Begin VB.Frame Frame1
ForeColor = &H000000FF&
Height = 1335
Left = 120
TabIndex = 12
Top = 720
Width = 2415
Begin VB.TextBox Text1
Appearance = 0 'Flat
DataField = "username"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 8
TabIndex = 1
Top = 240
Width = 1335
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
DataField = "userid"
DataSource = "Adodc1"
Height = 270
Left = 960
MaxLength = 8
TabIndex = 2
Top = 600
Width = 1335
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
DataField = "userpw"
DataSource = "Adodc1"
Height = 270
IMEMode = 3 'DISABLE
Left = 960
MaxLength = 8
PasswordChar = "*"
TabIndex = 3
Top = 960
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名称"
Height = 180
Left = 120
TabIndex = 15
Top = 285
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用 户 ID"
Height = 180
Left = 120
TabIndex = 14
Top = 630
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "用户密码"
Height = 180
Left = 120
TabIndex = 13
Top = 1005
Width = 720
End
End
Begin VB.Image Image1
Height = 480
Left = 2640
Picture = "Form1.frx":0553
Top = 1680
Width = 480
End
Begin VB.Label Label17
AutoSize = -1 'True
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 180
Left = -74880
TabIndex = 29
Top = 2640
Width = 90
End
Begin VB.Label Label16
AutoSize = -1 'True
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 180
Left = 120
TabIndex = 28
Top = 2160
Width = 90
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
If Combo1.ListCount = 9 Then
MsgBox "您最多只能添加9种支出类型!"
Text14.Text = ""
Exit Sub
End If
If Trim(Text14.Text) <> "" Then
Combo1.AddItem Text14.Text
Combo1.Text = Text14.Text
Adodc2.Recordset.Update
Adodc2.Recordset.AddNew
MsgBox "添加成功!"
Text14.SetFocus
Else
MsgBox "您不能添加空类型!"
Text14.SetFocus
End If
End Sub
Private Sub Command2_Click()
If Combo2.ListCount = 9 Then
MsgBox "您最多只能添加9种支出类型!"
Text15.Text = ""
Exit Sub
End If
If Trim(Text15.Text) <> "" Then
Combo2.AddItem Text15.Text
Combo2.Text = Text15.Text
Adodc3.Recordset.Update
Adodc3.Recordset.AddNew
MsgBox "添加成功!"
Text15.SetFocus
Else
MsgBox "您不能添加空类型!"
Text15.SetFocus
End If
End Sub
Private Sub Command4_Click()
'是否输入用户名或用户ID
If text1.Text = "" Or Text2.Text = "" Then
MsgBox "您必须填写“用户名”或者“用户ID”!"
Exit Sub
End If
'是否输入用户密码
If Text3.Text = "" Then
MsgBox "您必须填写“用户密码”!"
Exit Sub
End If
'金额是否为数字
If Not IsNumeric(Text6.Text) Or Not IsNumeric(Text7.Text) Or Not IsNumeric(Text8.Text) Or Not _
IsNumeric(Text9.Text) Or Not IsNumeric(Text10.Text) Then
MsgBox "输入金额必须为数字!"
Exit Sub
End If
'输入备份日期是否为数字
If Not IsNumeric(Text11.Text) Or Not IsNumeric(Text12.Text) Or Not IsNumeric(Text13.Text) Then
MsgBox "输入备份日期须为数字!"
Exit Sub
End If
'检查收支类型
If Combo1.ListCount = 0 Then
MsgBox "“在收支类型”里请至少添加一个“收入类型”!"
Exit Sub
End If
If Combo2.ListCount = 0 Then
MsgBox "“在收支类型”里请至少添加一个“支出类型”!"
Exit Sub
End If
Adodc1.Recordset.Update
'能够操作菜单
MDIForm1.Toolbar1.Enabled = True
MDIForm1.szjl.Enabled = True
MDIForm1.baobiao.Enabled = True
MDIForm1.sjcl.Enabled = True
Unload Me
End Sub
Private Sub Command5_Click()
Adodc1.Recordset.CancelUpdate
'如未设置则退出
If Adodc1.Recordset.BOF Then
MsgBox "您还未进行系统设置,软件将不能正常使用!"
End
Else
Unload Me
End If
End Sub
Private Sub Dir1_Change()
Text5.SetFocus
Text5.Text = Dir1.path
End Sub
Private Sub Drive1_Change()
Dir1.path = Drive1.Drive
Text5.SetFocus
Text5.Text = Dir1.path
End Sub
Private Sub Form_Load()
'初始化数据库
Adodc1.ConnectionString = ado
Adodc1.RecordSource = "csh"
Adodc1.Refresh
Adodc2.ConnectionString = ado
Adodc2.RecordSource = "sylx"
Adodc2.Refresh
Text14.DataField = "sylx"
Adodc3.ConnectionString = ado
Adodc3.RecordSource = "zclx"
Adodc3.Refresh
Text15.DataField = "zclx"
If Not Adodc2.Recordset.BOF Then
While Not Adodc2.Recordset.EOF
Combo1.AddItem Adodc2.Recordset.Fields(0)
Adodc2.Recordset.MoveNext
Wend
Combo1.Text = Combo1.List(0)
End If
Adodc2.Recordset.AddNew
If Not Adodc3.Recordset.BOF Then
While Not Adodc3.Recordset.EOF
Combo2.AddItem Adodc3.Recordset.Fields(0)
Adodc3.Recordset.MoveNext
Wend
Combo2.Text = Combo2.List(0)
End If
Adodc3.Recordset.AddNew
'判断是否为第一次使作本软件,如果是则调用添加,以免不能输入信息。
If Text2.Text = "" Then
Adodc1.Recordset.AddNew
'判断是否为第一次使用本软件,如果是则写入默认信息
text1.Text = "用户"
Text2.Text = "user"
Text3.Text = "password"
Text4.Text = Date
Text5.Text = App.path
Text6.Text = 0
Text7.Text = 0
Text8.Text = 0
Text9.Text = 0
Text10.Text = 0
Text11.Text = 1
Text12.Text = 10
Text13.Text = 20
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
'如未设置则退出
Adodc1.Recordset.CancelUpdate
If Adodc1.Recordset.BOF Then
MsgBox "您还未进行系统设置,软件将不能正常使用!"
End
Else
Unload Me
End If
End Sub
Private Sub Text1_GotFocus()
Label16.Caption = "请在这里输入或修改您的真实姓名!"
End Sub
Private Sub Text10_GotFocus()
Label18.Caption = "每次启动前将会提醒用户注意防止透支!"
End Sub
Private Sub Text11_GotFocus()
Label18.Caption = "如输入1,10,20等,大于31将无效!"
End Sub
Private Sub Text12_GotFocus()
Label18.Caption = "如输入1,10,20等,大于31将无效!"
End Sub
Private Sub Text13_GotFocus()
Label18.Caption = "如输入1,10,20等,大于31将无效!"
End Sub
Private Sub Text2_GotFocus()
Label16.Caption = "请在这里输入或修改登陆用的用户ID!"
End Sub
Private Sub Text3_GotFocus()
If Text3.Text = "password" Then
Label16.Caption = "初始密码为password!"
Else
Label16.Caption = "请在这里输入或修改用户密码!"
End If
End Sub
Private Sub Text5_GotFocus()
Label18.Caption = "您可以选定系统自动备份数据库时的路径!"
End Sub
Private Sub Text6_GotFocus()
Label17.Caption = "请在这里输入您现在银行里的存款金额!"
End Sub
Private Sub Text7_GotFocus()
Label17.Caption = "请在这里输入您现在手头上的金额!"
End Sub
Private Sub Text8_GotFocus()
Label17.Caption = "请在这里输入您巳经借给别人的金额!"
End Sub
Private Sub Text9_GotFocus()
Label17.Caption = "请在这里输入您从别人那借来的金额!"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -