求助vb大神,个人收支管理添加一个新功能

2024-05-19 11:48

1. 求助vb大神,个人收支管理添加一个新功能

添加类别:
Option1.Value = False And Option2.Value = False Then
Dim str1 As Integer
str1 = MsgBox("请选择收支类型,否则将默认为-收", 4128, "收支类型必须指明")
Option1.Value = True
s = "收"
ElseIf Option1.Value = True Then
s = "收"
ElseIf Option2.Value = True Then
s = "支"
End If
If Text_class_add.Text = "" Or Text_class_add.Text = "(不超过12字)" Then
Dim str2 As Integer
str2 = MsgBox("请输入收支类型的名称", 4128, "收支名称必须指明")
Else
On Error GoTo showerror
With rst
.AddNew
.Fields.Item("收支类型").Value = Text_class_add.Text
.Fields.Item("收支").Value = s
.Fields.Item("说明").Value = Text_shuoming
.Update
.Requery
End With
'------------显示全部记录
List_class.Clear
rst.MoveFirst
i = 0
Do While Not rst.EOF
List_class.List(i) = rst.Fields("收支类型").Value
List_shouzhi.List(i) = rst.Fields("收支").Value
rst.MoveNext
i = i + 1

Loop'------------结束
GoTo jump
showerror: MsgBox Err.Description
With dbs
If .State = adStateOpen Then
.Close
End If
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = App.Path & "\mymoney.mdb"
.Open
End With
With rst
If .State = adStateOpen Then
.Close
End If
.LockType = adLockOptimistic
.ActiveConnection = dbs
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open "收支类型表", Options:=adCmdTable

End With
jump:
End If

Text_class_add.Text = ""
Text_shuoming.Text = ""
Option1.Value = False
Option2.Value = False

End Sub
修改类别:
With rst
If .State = adStateOpen Then
.Close
End If
.LockType = adLockOptimistic
.ActiveConnection = dbs
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open "收支类型表", Options:=adCmdTable

End With
rst.MoveFirst
Do While Not rst.EOF
If ss = rst.Fields("收支类型").Value Then
If Option1.Value = True Then
s = "收"
ElseIf Option2.Value = True Then
s = "支"
End If

If Text_class_add.Text = "" Or Text_class_add.Text = "(不超过12字)" Then
Dim str2 As Integer
str2 = MsgBox("请输入收支类型的名称", 4128, "收支名称必须指明")
Else



On Error GoTo showerror


With rst


.Fields.Item("收支类型").Value = Text_class_add.Text
.Fields.Item("收支").Value = s
.Fields.Item("说明").Value = Text_shuoming
.Update
.Requery
End With
'------------显示全部记录
List_class.Clear
rst.MoveFirst
i = 0
Do While Not rst.EOF
List_class.List(i) = rst.Fields("收支类型").Value
List_shouzhi.List(i) = rst.Fields("收支").Value
rst.MoveNext
i = i + 1

Loop
'------------结束
GoTo jump
showerror:
MsgBox Err.Description
With dbs
If .State = adStateOpen Then
.Close
End If
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = App.Path & "\mymoney.mdb"
.Open
End With
With rst
If .State = adStateOpen Then
.Close
End If
.LockType = adLockOptimistic
.ActiveConnection = dbs
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open "收支类型表", Options:=adCmdTable

End With
jump:


Text_class_add.Text = ""
Text_shuoming.Text = ""
Option1.Value = False
Option2.Value = False
End If
Exit Do
End If
rst.MoveNext
Loop
Command_update.Enabled = False
Command_class_add.Enabled = True
End Sub
收支类型说明:
ss = List_class.Text
m = 0 '<----------判断哪条记录被选定

For i = 0 To List_class.ListCount - 1

If List_class.Selected(i) = True Then
m = i
Exit For
End If
Next i
List_shouzhi.Selected(m) = True


rst.Requery

Do While Not rst.EOF
If List_class.Text = rst.Fields("收支类型").Value Then


Command_class_add.Enabled = False
Command_update.Enabled = True

Text_class_add.Text = rst.Fields("收支类型")
If IsNull(rst.Fields("说明").Value) Then
Label_shuoming.Caption = "无详细说明"
Text_shuoming.Text = ""
Else
Label_shuoming.Caption = rst.Fields("说明").Value
Text_shuoming.Text = rst.Fields("说明").Value
End If
If rst.Fields("收支") = "收" Then
Option1.Value = True
Else
Option2.Value = True
End If

Exit Do
End If
rst.MoveNext
Loop
rst.Requery
End Sub
银行卡添加:
With rst

.AddNew
.Fields(0).Value = Text_cardnum.Text
.Fields(1).Value = Text_cardname2.Text
.Fields(2).Value = Text_bankname2.Text
.Fields(3).Value = DTPicker_card2.Value
.Fields(4).Value = Text_cardmore2.Text
.Update
.Requery
End With
'------------显示全部记录
List_cardname.Clear
' rst.MoveFirst
i = 0
Do While Not rst.EOF
List_cardname.List(i) = rst.Fields(1).Value
rst.MoveNext
i = i + 1
Loop
'------------结束
Text_cardnum.Text = ""
Text_cardname2.Text = ""
Text_bankname2.Text = ""
DTPicker_card2.Value = Date
Text_cardmore2.Text = ""
GoTo jump
showerror: MsgBox Err.Description
cnndata
rsttable "银行卡表"
jump:
End Sub
银行卡删除:
s = MsgBox("确定要删除该卡吗?删除后该卡的所有收支记录会丢失", vbYesNo, "删除选定银行卡")
If s = 6 Then

On Error GoTo showerror
rst.Requery
rst.Move (List_cardname.ListIndex)
rst.Delete
rst.Requery
'------------显示全部记录
List_cardname.Clear
' rst.MoveFirst
i = 0
Do While Not rst.EOF
List_cardname.List(i) = rst.Fields(1).Value
rst.MoveNext
i = i + 1
Loop
Text_cardname1.Text = ""
Text_bankname1.Text = ""
DTPicker_card1.Value = Date
Text_cardmore1.Text = ""
GoTo jump
showerror: MsgBox Err.Description
cnndata
rsttable "银行卡表"
jump:
End If

End Sub

支出查询:

cnndata
'<---------初始显示当月全部类型的支出
If Combo_class.Text = "" Or Combo_class.Text = "全部支出类型" Then
'-------所有支出类型查询
If Check_zhi_all.Value = 1 Then
'--------所有类型,所有日期查询
sql = "select 收支名称 as 支出名称,收支类型表.收支类型 as 项目,收支日期 as 支出日期,金额,备注 from 收支记录表,收支类型表 where 收支记录表.收支类型=收支类型表.收支类型 and 收支='支'and 收支记录表.收支类型  '银行存款'"
ElseIf Check_zhi_all.Value = 0 Then
'---------所有类型,按月查询
sql = "select 收支名称 as 支出名称,收支类型表.收支类型 as 项目,收支日期 as 支出日期,金额,备注 from 收支记录表,收支类型表 where 收支记录表.收支类型=收支类型表.收支类型 and 收支='支'and 收支记录表.收支类型  '银行存款' and 收支记录表.收支日期 between #" & RTrim(Combo_year.Text) & "-" & RTrim(Combo_month.Text) & "-1#" & "and#" & RTrim(Combo_year.Text) & "-" & RTrim(Combo_month.Text) & "-" & daynum & "#"
End If

Else
'--------固定类型查询
If Check_zhi_all.Value = 1 Then
'---------固定类型,所有日期查询
sql = "select 收支名称 as 支出名称,收支类型表.收支类型 as 项目,收支日期 as 支出日期,金额,备注 from 收支记录表,收支类型表 where 收支记录表.收支类型=收支类型表.收支类型 and 收支='支'and 收支类型表.收支类型='" & RTrim(Combo_class.Text) & "'"
ElseIf Check_zhi_all.Value = 0 Then
'----------固定类型,按日期查询
sql = "select 收支名称 as 支出名称,收支类型表.收支类型 as 项目,收支日期 as 支出日期,金额,备注 from 收支记录表,收支类型表 where 收支记录表.收支类型=收支类型表.收支类型 and 收支='支'and 收支类型表.收支类型='" & RTrim(Combo_class.Text) & "'and 收支记录表.收支日期 between #" & RTrim(Combo_year.Text) & "-" & RTrim(Combo_month.Text) & "-1#" & "and#" & RTrim(Combo_year.Text) & "-" & RTrim(Combo_month.Text) & "-" & daynum & "#"
End If

End If

求助vb大神,个人收支管理添加一个新功能

2. 我想用vb做一个报表,就像个人简历的那种表 该如何实现

一种是数据把表设计器设计
一种是控制WORD
都可以

3. VB编写一个"个人简历表"程序

Dim xm As String, nl As String, xb As String, xl As String, zy As String
Dim ah1 As String, ah2 As String, ah3 As String, ah4 As String
Private Sub Check1_Click()
If Check1.Value = 1 Then ah1 = "旅游" Else ah1 = ""
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then ah2 = "体育" Else ah2 = ""
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then ah3 = "音乐" Else ah3 = ""
End Sub
Private Sub Check41_Click()
If Check4.Value = 1 Then ah4 = "集邮" Else ah4 = ""
End Sub
Private Sub Command1_Click()
Text3.Text = "简历" & vbCrLf & "姓名:" & xm & vbCrLf & "年龄:" & nl & vbCrLf & "性别:" & xb & vbCrLf & "学历:" & xl & vbCrLf & "职业:" & zy & vbCrLf & "爱好:" & ah1 & ah2 & ah3 & ah4
End Sub
Private Sub Command2_Click()
Text1 = "": xm = ""
Text2 = "": nl = ""
Text3 = ""
Check1.Value = 0: ah1 = ""
Check2.Value = 0: ah2 = ""
Check3.Value = 0: ah3 = ""
Check4.Value = 0: ah4 = ""
End Sub
Private Sub Form_Load()
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then xb = "男"
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then xb = "女"
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then xl = "大学"
End Sub
Private Sub Option4_Click()
If Option4.Value = True Then xl = "本科"
End Sub
Private Sub Option5_Click()
If Option5.Value = True Then xl = "研究生"
End Sub
Private Sub Option6_Click()
If Option6.Value = True Then zy = "教师"
End Sub
Private Sub Option7_Click()
If Option7.Value = True Then zy = "医生"
End Sub
Private Sub Option8_Click()
If Option8.Value = True Then zy = "公务员"
End Sub

Private Sub Text1_Change()
xm = Text1.Text
End Sub
Private Sub Text2_Change()
nl = Text2.Text
End Sub

VB编写一个"个人简历表"程序

4. 如何用VB制作统计表类的程序?

利用access数据库即可,百度一下就能找到access相关的操作(连接、创建表、增加、修改、删除之类的)。这个还是比较简单的。

5. VB怎么制作表格

直接调用Excel类型的电子表格,你想咋做就咋做。
Option Explicit    Dim xlapp As Object    Dim xlBook As Object    Dim xlSheet As Object    Private Sub Command1_Click()    Set xlapp = CreateObject("excel.application")    xlapp.Visible = True    Set xlBook = xlapp.Workbooks.Add    Set xlSheet = xlBook.worksheets(1)End Sub

VB怎么制作表格

6. 求用vb程序设计 做一份个人简历表的代码,如下图

可好?

7. 我急需要一个人帮我做一个VB 个人消费管理系统,谢谢,不要复杂,能用就行

你的问题在这里是得不到解决的,没人会花上几天时间给你干苦力,消费记账软件很多,你可以百度到

我急需要一个人帮我做一个VB 个人消费管理系统,谢谢,不要复杂,能用就行

8. VB 如何生成EXCEL表格?谢谢了

材料/工具:电脑、VB 6.0软件
1、首先,我们需要点击文件菜单栏按钮。

2、然后,我们点击生成EXE按钮。

3、接下来,我们点击保存路径。

4、然后,我们输入我们想要保存的文件名。

5、最后,我们点击确定按钮。

6、然后,我们便可以看到,在桌面生成了Excel表格了。