家庭财务管理系统课程设计的原代码_第1页
家庭财务管理系统课程设计的原代码_第2页
家庭财务管理系统课程设计的原代码_第3页
家庭财务管理系统课程设计的原代码_第4页
家庭财务管理系统课程设计的原代码_第5页
已阅读5页,还剩42页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1、frm_borrowgo.frmdim mydb as new adodb.recordsetdim mydb1 as new adodb.recordsetdim str_text as stringdim strflag as stringprivate sub cmd_add_click() txt_man.locked = false txt_way.locked = false txt_money.locked = false combo1.locked = false check1.enabled = true dtpicker1.enabled = true txt_man.

2、text = txt_way.text = txt_money.text = combo1.text = strflag = 添加 cmdsave.enabled = trueend subprivate sub cmd_close_click() unload meend subprivate sub cmd_del_click() dim a as boolean a = msgbox(是否真的要删除这条记录?, vbokcancel + 32 + 256, 删除) if a = true then executesql delete from 借出 where 得款人= & txt_ma

3、n.text & , str_text msgbox 记录已删除!, , 删除 if mydb.recordcount 0 then mydb.movenext if mydb.eof then mydb.movelast call db call bangding label7.caption = mydb.recordcount end if end ifend subprivate sub cmd_edit_click() on error resume next dim a as boolean txt_man.locked = false txt_way.locked = false

4、 txt_money.locked = false combo1.locked = false check1.enabled = true dtpicker1.enabled = true strflag = 修改 cmdsave.enabled = trueend subprivate sub cmdsave_click() on error resume next dim a as boolean if strflag = 添加 then a = msgbox(是否添加前记录?, vbyesno + 32, 添加记录) if a = true then executesql insert

5、into 借出 values( & txt_man.text & , & txt_money.text & , & combo1.text & , & dtpicker1.value & , & txt_way.text & , & check1.value & ), str_text msgbox 数据已经保存!, vbokonly + 64, 成功 call db label7.caption = mydb.recordcount end if elseif strflag = 修改 then a = msgbox(是否修改前记录?, vbyesno + 32, 添加记录) if a =

6、true then mydb.update mydb.requery call db msgbox 数据修改成功!, vbokonly + 64, 成功 end if end if cmdsave.enabled = false txt_man.locked = true txt_way.locked = true txt_money.locked = true combo1.locked = true check1.enabled = false dtpicker1.enabled = falseend subprivate sub combo1_change() dim a as inte

7、ger set mydb1 = executesql(select 姓名 from 成员, str_text) set combo1.datasource = mydb1 a = mydb1.recordcount for i = 1 to a combo1.additem mydb1.fields(0) mydb1.movenext if mydb1.eof then exit for next iend subprivate sub command1_click() on error resume next call db mydb.movefirst call bangdingend s

8、ubprivate sub command2_click() on error resume next call db if not mydb.bof then mydb.moveprevious mydb.moveprevious if mydb.bof then msgbox 这已经是第一条记录了!, vbokonly + 32, 注意 mydb.movefirst end if call bangdingend subprivate sub command3_click() on error resume next call db mydb.moveprevious if mydb.bo

9、f then msgbox 这已经是第一条记录了!, vbokonly + 32, 注意 mydb.movefirst end if mydb.movenext if mydb.eof then msgbox 这已经是最后一条记录了!, vbokonly + 32, 注意 mydb.movelast end if call bangdingend subprivate sub command4_click() on error resume next call db mydb.movelast call bangdingend subprivate sub form_load() on err

10、or resume next set mydb = executesql(select * from 借出, str_text) call db call bangding check1.value = 0 label7.caption = mydb.recordcount dtpicker1.value = date cmdsave.enabled = false txt_man.locked = true txt_way.locked = true txt_money.locked = true combo1.locked = true check1.enabled = false dtp

11、icker1.enabled = falseend subprivate function db() on error resume next set mydb = executesql(select * from 借出, str_text)end functionprivate function bangding() on error resume next set txt_man.datasource = mydb set txt_money.datasource = mydb set dtpicker1.datasource = mydb set txt_way.datasource =

12、 mydb set check1.datasource = mydb txt_man.datafield = 得款人 txt_money.datafield = 金额 dtpicker1.value = 日期 txt_way.datafield = 借款原因 check1.datafield = 已还 set combo1.datasource = mydb combo1.datafield = 出借人end function2、frm_borromin.frmdim mydb as new adodb.recordsetdim mydb1 as new adodb.recordsetdim

13、str_text as stringdim strflag as stringprivate sub cmd_close_click() unload meend subprivate sub cmd_add_click() txt_man.locked = false txt_way.locked = false txt_money.locked = false combo1.locked = false check1.enabled = true dtpicker1.enabled = true txt_man.text = txt_way.text = txt_money.text =

14、combo1.text = strflag = 添加 cmdsave.enabled = trueend subprivate sub cmd_del_click() dim a as boolean a = msgbox(是否真的要删除这条记录?, vbokcancel + 32 + 256, 删除) if a = true then executesql delete from 借入 where 得款人= & txt_man.text & , str_text msgbox 记录已删除!, , 删除 if mydb.recordcount 0 then mydb.movenext if m

15、ydb.eof then mydb.movelast call db call bangding label7.caption = mydb.recordcount end if end ifend subprivate sub cmd_edit_click() on error resume next dim a as boolean txt_man.locked = false txt_way.locked = false txt_money.locked = false combo1.locked = false check1.enabled = true dtpicker1.enabl

16、ed = true strflag = 修改 cmdsave.enabled = trueend subprivate sub cmdsave_click() on error resume next dim a as boolean if strflag = 添加 then a = msgbox(是否添加前记录?, vbyesno + 32, 添加记录) if a = true then executesql insert into 借入 values( & txt_man.text & , & txt_money.text & , & combo1.text & , & format(dt

17、picker1.value, yyyy-mm-dd) & , & txt_way.text & , & check1.value & ), str_text msgbox 数据已经保存!, vbokonly + 64, 成功 call db label7.caption = mydb.recordcount end if elseif strflag = 修改 then a = msgbox(是否修改前记录?, vbyesno + 32, 添加记录) if a = true then mydb.update mydb.requery call db msgbox 数据修改成功!, vbokon

18、ly + 64, 成功 end if end if txt_man.locked = true txt_way.locked = true txt_money.locked = true combo1.locked = true check1.enabled = false dtpicker1.enabled = false cmdsave.enabled = falseend subprivate sub combo1_change() set mydb1 = executesql(select 姓名 from 成员, str_text) set combo1.datasource = my

19、db1 for i = 1 to mydb1.recordcount combo1.additem (mydb1.fields(0) mydb1.movenext if mydb1.eof then exit for next iend subprivate sub command1_click() on error resume next call db mydb.movefirst call bangdingend subprivate sub command3_click() on error resume next call db mydb.movenext if mydb.eof t

20、hen msgbox 这已经是最后一条记录了!, vbokonly + 32, 注意 mydb.movelast end if call bangdingend subprivate sub command2_click() on error resume next mydb.moveprevious if mydb.bof then msgbox 这已经是第一条记录了!, vbokonly + 32, 注意 mydb.movefirst end if call bangdingend subprivate sub command4_click() on error resume next c

21、all db mydb.movelast call bangdingend subprivate sub form_load() on error resume next call db call bangding cmdsave.enabled = false check1.value = 0 label7.caption = mydb.recordcount dtpicker1.value = date txt_man.locked = true txt_way.locked = true txt_money.locked = true combo1.locked = true check

22、1.enabled = false dtpicker1.enabled = falseend subprivate function db() set mydb = executesql(select * from 借入, str_text)end functionprivate function bangding() on error resume next set txt_man.datasource = mydb set txt_money.datasource = mydb set dtpicker1.datasource = mydb set txt_way.datasource =

23、 mydb set check1.datasource = mydb txt_man.datafield = 得款人 txt_money.datafield = 金额 dtpicker1.datafield = 日期 txt_way.datafield = 出借原因 check1.datafield = 已还 set combo1.datasource = mydb combo1.datafield = 出借人end function3、frm_choose.frmprivate sub cmd_choose_click() on error resume next commondialog1

24、.filter = database(*.mdb)|*.mdb commondialog1.showopen str_path = commondialog1.filename text1.text = commondialog1.filename savesetting 小财迷, personal, 路径, str_path text2.text = commondialog1.filename if text2.text then frm_login.show unload me else show end if end subprivate sub cmd_ok_click() on e

25、rror resume next str_path = text1.text savesetting 小财迷, personal, 路径, str_path frm_login.show unload meend sub4、frm_date.frmdim mydb as new adodb.recordsetdim riqi, riqi1, year1, month as stringprivate sub command1_click() dim riqi, riqi1, year, month as string if combo1.text = then msgbox 请选择年份!, v

26、bokonly + 32, 注意! else if combo2.text = then msgbox 请选择月份!, vbokonly + 32, 注意! else aa = true year1 = combo1.text month = combo2.text riqi = year1 & - & month riqi1 = year1 & - & month + 1 msgbox riqi set mydb = executesql(select * from 收入 where 日期 between & riqi & and & riqi1 & , ) cdate1 = format(

27、riqi, yyyy-mm) cdate2 = format(riqi1, yyyy-mm) unload me end if end if end subprivate sub form_load() dim a as integer a = 2000 for i = 2000 to int(year(now) combo1.additem a a = a + 1 next iend sub5、frm_expend.frmdim mydb as new adodb.recordsetdim mydb1 as new adodb.recordsetdim mydb2 as new adodb.

28、recordsetdim count1 as new adodb.recordsetdim str_text as stringprivate sub cmd_add_click() on error resume next dim a, b b = 1 set count1 = executesql(select * from 支出, str_text) count1.movelast b = count1.fields(7) + 1 a = msgbox(是否添加前记录?, vbyesno + 32, 添加记录) if a = vbyes then if txt_intake.text =

29、 then msgbox 请填写去向!, vbokonly + 32, 注意! else executesql insert into 支出 values( & format(dtpicker1.value, yyyy-mm-dd) & , _ & combo1.text & , & txt_money.text & , & combo2.text & , & txt_intake.text _ & , & combo3.text & , & txt_mome.text & , & b & ), str_text msgbox 数据已经保存!, vbokonly + 64, 成功 call x

30、iangmu call db end if end if end subprivate sub cmd_close_click() unload meend subprivate sub cmd_del_click() on error resume next dim a a = msgbox(是否删除当前记录?, vbyesno + 32 + 256, 添加记录) if a = vbyes then executesql delete from 支出 where key= & txt_note.text & , str_text call db set mydb = executesql(s

31、elect * from 支出 , str_text) set mshflexgrid1.datasource = mydb end ifend subprivate sub cmd_edit_click() on error resume next dim a a = msgbox(是否修改前记录?, vbyesno + 32, 添加记录) if a = vbyes then executesql update 支出 set 日期 = & format(dtpicker1.value, yyyy-mm-dd) & ,方式= & combo1.text & ,金额= & txt_money.t

32、ext & , 去向= & txt_intake.text & ,人员= & combo3.text & ,备注= & txt_mome.text & where key = & txt_note.text & , str_text mydb.requery call db msgbox 数据修改成功!, vbokonly + 64, 成功 end if end subprivate sub combo2_change() call db1end subprivate sub combo3_change() call db2end subprivate sub form_load() call

33、 db call db1 call db2 dtpicker1.value = date combo3.locked = true combo1.locked = trueend subpublic function db() set mydb = executesql(select * from 支出 order by key, str_text) set mshflexgrid1.datasource = mydbend functionpublic function db1() on error resume next dim a as integer set mydb1 = execu

34、tesql(select * from 支出项目 , str_text) a = mydb1.recordcount set combo2.datasource = mydb1 for i = 1 to a combo2.additem mydb1.fields(0) mydb1.movenext if mydb1.eof then exit for next iend functionpublic function db2() on error resume next dim a as integer set mydb2 = executesql(select * from 成员, str_

35、text) a = mydb2.recordcount set combo3.datasource = mydb2 for i = 1 to a combo3.additem mydb2.fields(0) mydb2.movenext if mydb2.eof then exit for next i combo3.additem 全家end functionprivate sub form_unload(cancel as integer) mydb.close mydb1.close mydb2.closeend subprivate sub mshflexgrid1_click() o

36、n error resume next dtpicker1.value = mshflexgrid1.textmatrix(mshflexgrid1.row, 1) combo1.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 2) txt_money.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 3) combo2.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 4) txt_intake.text = mshflexgrid1.textma

37、trix(mshflexgrid1.row, 5) combo3.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 6) txt_mome.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 7) txt_note.text = mshflexgrid1.textmatrix(mshflexgrid1.row, 8)end sub private sub txt_money_lostfocus() dim a as boolean dim c c = txt_money.text a = isnume

38、ric(c) if c = then msgbox 请输入金额!, vbokonly + 32, 注意! txt_money.setfocus else if a = false then msgbox 金额只能输入数字!, vbokonly + 32, 注意! txt_money.setfocus end if end ifend subprivate function xiangmu() dim a dim str_text as string dim db as new adodb.recordset str_text = combo2.text set db = executesql(

39、select * from 支出项目 where value= & str_text & , ) msgbox if not str_text = db.fields(0) then executesql insert into 支出项目 values( & str_text & ), end ifend functionprivate function renyuan() dim a dim str_text as string dim db as new adodb.recordset str_text = combo3.text set db = executesql(select *

40、from 成员 where value= & str_text & , ) msgbox if not str_text = db.fields(0) then executesql insert into 成员 values( & str_text & ), end ifend function6、frm_family.frmdim mydb as new adodb.recordsetdim mydb1 as new adodb.recordsetdim count1 as new adodb.recordsetdim str_text as stringprivate sub cmd_a

41、dd_click() on error resume next dim a, b b = 1 set count1 = executesql(select * from 成员 , str_text) count1.movelast b = count1.fields(4) + 1 a = msgbox(是否添加前记录?, vbyesno + 32, 修改记录) if a = vbyes then executesql insert into 成员 values( & text1.text & , & text2.text & , & format(dtpicker1.value, yyyy-m

42、m-dd) & , & text3.text & , & b & ) , str_text call db mydb.movelast msgbox 数据已经保存!, vbokonly + 64, 成功 end ifend subprivate sub cmd_close_click() unload meend subprivate sub cmd_del_click() on error resume next dim a a = msgbox(是否删除当前记录, vbyesno + 32 + 256, 删除记录) if a = vbyes then executesql delete from 成员 where key= & txt_key.text & , str_text mydb.requery if mydb.eof then mydb.movelast call db set mydb = executesql(select * from 成员, str_text) set mshflexgrid1.datasource = m

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论