Lentfrm.frm
上传用户:zhuahui520
上传日期:2007-05-21
资源大小:347k
文件大小:26k
源码类别:

其他智力游戏

开发平台:

Java

  1. VERSION 5.00
  2. Begin VB.Form Lentfrm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "归还图书"
  5.    ClientHeight    =   6255
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   7665
  9.    Icon            =   "Lentfrm.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   6255
  14.    ScaleWidth      =   7665
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  '屏幕中心
  17.    Begin VB.Frame Frame5 
  18.       Caption         =   "还书"
  19.       BeginProperty Font 
  20.          Name            =   "楷体_GB2312"
  21.          Size            =   14.25
  22.          Charset         =   134
  23.          Weight          =   700
  24.          Underline       =   0   'False
  25.          Italic          =   0   'False
  26.          Strikethrough   =   0   'False
  27.       EndProperty
  28.       ForeColor       =   &H00FF0000&
  29.       Height          =   6015
  30.       Left            =   120
  31.       TabIndex        =   0
  32.       Top             =   240
  33.       Width           =   7455
  34.       Begin VB.CommandButton cmdExit 
  35.          BackColor       =   &H0000C000&
  36.          Cancel          =   -1  'True
  37.          BeginProperty Font 
  38.             Name            =   "宋体"
  39.             Size            =   7.5
  40.             Charset         =   134
  41.             Weight          =   400
  42.             Underline       =   0   'False
  43.             Italic          =   0   'False
  44.             Strikethrough   =   0   'False
  45.          EndProperty
  46.          Height          =   615
  47.          Left            =   120
  48.          Picture         =   "Lentfrm.frx":0442
  49.          Style           =   1  'Graphical
  50.          TabIndex        =   31
  51.          ToolTipText     =   "关闭此对话框"
  52.          Top             =   5160
  53.          Width           =   735
  54.       End
  55.       Begin VB.TextBox txtBookBian1 
  56.          BeginProperty Font 
  57.             Name            =   "宋体"
  58.             Size            =   12
  59.             Charset         =   134
  60.             Weight          =   700
  61.             Underline       =   0   'False
  62.             Italic          =   0   'False
  63.             Strikethrough   =   0   'False
  64.          EndProperty
  65.          ForeColor       =   &H00FF0000&
  66.          Height          =   360
  67.          Left            =   3120
  68.          TabIndex        =   13
  69.          Text            =   "Text1"
  70.          Top             =   660
  71.          Width           =   2055
  72.       End
  73.       Begin VB.Frame Frame6 
  74.          Height          =   3495
  75.          Left            =   120
  76.          TabIndex        =   2
  77.          Top             =   1560
  78.          Visible         =   0   'False
  79.          Width           =   7215
  80.          Begin VB.TextBox txtFa 
  81.             BeginProperty Font 
  82.                Name            =   "宋体"
  83.                Size            =   10.5
  84.                Charset         =   134
  85.                Weight          =   400
  86.                Underline       =   0   'False
  87.                Italic          =   0   'False
  88.                Strikethrough   =   0   'False
  89.             EndProperty
  90.             ForeColor       =   &H000000FF&
  91.             Height          =   330
  92.             Left            =   5880
  93.             TabIndex        =   28
  94.             Text            =   "Text1"
  95.             Top             =   2760
  96.             Width           =   855
  97.          End
  98.          Begin VB.TextBox txtChaoChu 
  99.             BeginProperty Font 
  100.                Name            =   "宋体"
  101.                Size            =   10.5
  102.                Charset         =   134
  103.                Weight          =   400
  104.                Underline       =   0   'False
  105.                Italic          =   0   'False
  106.                Strikethrough   =   0   'False
  107.             EndProperty
  108.             ForeColor       =   &H000000FF&
  109.             Height          =   315
  110.             Left            =   3480
  111.             TabIndex        =   26
  112.             Text            =   "Text1"
  113.             Top             =   2760
  114.             Width           =   1215
  115.          End
  116.          Begin VB.TextBox txtXianDing 
  117.             BeginProperty Font 
  118.                Name            =   "宋体"
  119.                Size            =   10.5
  120.                Charset         =   134
  121.                Weight          =   400
  122.                Underline       =   0   'False
  123.                Italic          =   0   'False
  124.                Strikethrough   =   0   'False
  125.             EndProperty
  126.             ForeColor       =   &H000000FF&
  127.             Height          =   330
  128.             Left            =   5880
  129.             TabIndex        =   24
  130.             Text            =   "Text1"
  131.             Top             =   2160
  132.             Width           =   855
  133.          End
  134.          Begin VB.TextBox txtLentDay 
  135.             BeginProperty Font 
  136.                Name            =   "宋体"
  137.                Size            =   10.5
  138.                Charset         =   134
  139.                Weight          =   400
  140.                Underline       =   0   'False
  141.                Italic          =   0   'False
  142.                Strikethrough   =   0   'False
  143.             EndProperty
  144.             ForeColor       =   &H000000FF&
  145.             Height          =   300
  146.             Left            =   1200
  147.             TabIndex        =   22
  148.             Text            =   "Text1"
  149.             Top             =   2760
  150.             Width           =   1215
  151.          End
  152.          Begin VB.TextBox txtToday 
  153.             BeginProperty Font 
  154.                Name            =   "宋体"
  155.                Size            =   10.5
  156.                Charset         =   134
  157.                Weight          =   400
  158.                Underline       =   0   'False
  159.                Italic          =   0   'False
  160.                Strikethrough   =   0   'False
  161.             EndProperty
  162.             ForeColor       =   &H000000FF&
  163.             Height          =   315
  164.             Left            =   3480
  165.             TabIndex        =   20
  166.             Text            =   "Text1"
  167.             Top             =   2160
  168.             Width           =   1215
  169.          End
  170.          Begin VB.TextBox txtType1 
  171.             BeginProperty Font 
  172.                Name            =   "宋体"
  173.                Size            =   10.5
  174.                Charset         =   134
  175.                Weight          =   400
  176.                Underline       =   0   'False
  177.                Italic          =   0   'False
  178.                Strikethrough   =   0   'False
  179.             EndProperty
  180.             ForeColor       =   &H00FF0000&
  181.             Height          =   315
  182.             Left            =   5520
  183.             TabIndex        =   18
  184.             Text            =   "Text1"
  185.             Top             =   360
  186.             Width           =   1455
  187.          End
  188.          Begin VB.TextBox txtBookhao1 
  189.             BeginProperty Font 
  190.                Name            =   "宋体"
  191.                Size            =   10.5
  192.                Charset         =   134
  193.                Weight          =   400
  194.                Underline       =   0   'False
  195.                Italic          =   0   'False
  196.                Strikethrough   =   0   'False
  197.             EndProperty
  198.             ForeColor       =   &H00FF0000&
  199.             Height          =   315
  200.             Left            =   1200
  201.             TabIndex        =   7
  202.             Text            =   "Text1"
  203.             Top             =   360
  204.             Width           =   1575
  205.          End
  206.          Begin VB.TextBox txtCost1 
  207.             BeginProperty Font 
  208.                Name            =   "宋体"
  209.                Size            =   10.5
  210.                Charset         =   134
  211.                Weight          =   400
  212.                Underline       =   0   'False
  213.                Italic          =   0   'False
  214.                Strikethrough   =   0   'False
  215.             EndProperty
  216.             ForeColor       =   &H00FF0000&
  217.             Height          =   315
  218.             Left            =   3600
  219.             TabIndex        =   6
  220.             Text            =   "Text1"
  221.             Top             =   360
  222.             Width           =   1095
  223.          End
  224.          Begin VB.TextBox txtBookname1 
  225.             BeginProperty Font 
  226.                Name            =   "宋体"
  227.                Size            =   10.5
  228.                Charset         =   134
  229.                Weight          =   400
  230.                Underline       =   0   'False
  231.                Italic          =   0   'False
  232.                Strikethrough   =   0   'False
  233.             EndProperty
  234.             ForeColor       =   &H00FF0000&
  235.             Height          =   345
  236.             Left            =   1200
  237.             TabIndex        =   5
  238.             Text            =   "Text1"
  239.             Top             =   960
  240.             Width           =   3495
  241.          End
  242.          Begin VB.TextBox txtChuban1 
  243.             BeginProperty Font 
  244.                Name            =   "宋体"
  245.                Size            =   10.5
  246.                Charset         =   134
  247.                Weight          =   400
  248.                Underline       =   0   'False
  249.                Italic          =   0   'False
  250.                Strikethrough   =   0   'False
  251.             EndProperty
  252.             ForeColor       =   &H00FF0000&
  253.             Height          =   345
  254.             Left            =   1200
  255.             TabIndex        =   4
  256.             Text            =   "Text1"
  257.             Top             =   1560
  258.             Width           =   3495
  259.          End
  260.          Begin VB.TextBox txtLentDate1 
  261.             BeginProperty Font 
  262.                Name            =   "宋体"
  263.                Size            =   10.5
  264.                Charset         =   134
  265.                Weight          =   400
  266.                Underline       =   0   'False
  267.                Italic          =   0   'False
  268.                Strikethrough   =   0   'False
  269.             EndProperty
  270.             ForeColor       =   &H000000FF&
  271.             Height          =   315
  272.             Left            =   1200
  273.             TabIndex        =   3
  274.             Text            =   "Text1"
  275.             Top             =   2160
  276.             Width           =   1215
  277.          End
  278.          Begin VB.Label Label2 
  279.             AutoSize        =   -1  'True
  280.             Caption         =   "员"
  281.             BeginProperty Font 
  282.                Name            =   "宋体"
  283.                Size            =   10.5
  284.                Charset         =   134
  285.                Weight          =   400
  286.                Underline       =   0   'False
  287.                Italic          =   0   'False
  288.                Strikethrough   =   0   'False
  289.             EndProperty
  290.             ForeColor       =   &H00000000&
  291.             Height          =   210
  292.             Index           =   7
  293.             Left            =   6840
  294.             TabIndex        =   30
  295.             Top             =   2760
  296.             Width           =   210
  297.          End
  298.          Begin VB.Label Label2 
  299.             AutoSize        =   -1  'True
  300.             Caption         =   "天"
  301.             BeginProperty Font 
  302.                Name            =   "宋体"
  303.                Size            =   10.5
  304.                Charset         =   134
  305.                Weight          =   400
  306.                Underline       =   0   'False
  307.                Italic          =   0   'False
  308.                Strikethrough   =   0   'False
  309.             EndProperty
  310.             ForeColor       =   &H00000000&
  311.             Height          =   210
  312.             Index           =   6
  313.             Left            =   6840
  314.             TabIndex        =   29
  315.             Top             =   2160
  316.             Width           =   210
  317.          End
  318.          Begin VB.Label Label2 
  319.             AutoSize        =   -1  'True
  320.             Caption         =   "罚款金额"
  321.             BeginProperty Font 
  322.                Name            =   "宋体"
  323.                Size            =   10.5
  324.                Charset         =   134
  325.                Weight          =   400
  326.                Underline       =   0   'False
  327.                Italic          =   0   'False
  328.                Strikethrough   =   0   'False
  329.             EndProperty
  330.             ForeColor       =   &H00000000&
  331.             Height          =   210
  332.             Index           =   5
  333.             Left            =   4920
  334.             TabIndex        =   27
  335.             Top             =   2760
  336.             Width           =   840
  337.          End
  338.          Begin VB.Label Label2 
  339.             AutoSize        =   -1  'True
  340.             Caption         =   "超出天数"
  341.             BeginProperty Font 
  342.                Name            =   "宋体"
  343.                Size            =   10.5
  344.                Charset         =   134
  345.                Weight          =   400
  346.                Underline       =   0   'False
  347.                Italic          =   0   'False
  348.                Strikethrough   =   0   'False
  349.             EndProperty
  350.             ForeColor       =   &H00000000&
  351.             Height          =   210
  352.             Index           =   4
  353.             Left            =   2520
  354.             TabIndex        =   25
  355.             Top             =   2760
  356.             Width           =   840
  357.          End
  358.          Begin VB.Label Label2 
  359.             AutoSize        =   -1  'True
  360.             Caption         =   "限定天数"
  361.             BeginProperty Font 
  362.                Name            =   "宋体"
  363.                Size            =   10.5
  364.                Charset         =   134
  365.                Weight          =   400
  366.                Underline       =   0   'False
  367.                Italic          =   0   'False
  368.                Strikethrough   =   0   'False
  369.             EndProperty
  370.             ForeColor       =   &H00000000&
  371.             Height          =   210
  372.             Index           =   3
  373.             Left            =   4920
  374.             TabIndex        =   23
  375.             Top             =   2160
  376.             Width           =   840
  377.          End
  378.          Begin VB.Image Image2 
  379.             Height          =   480
  380.             Left            =   5640
  381.             Picture         =   "Lentfrm.frx":0884
  382.             Top             =   1200
  383.             Width           =   480
  384.          End
  385.          Begin VB.Label Label2 
  386.             AutoSize        =   -1  'True
  387.             Caption         =   "借出天数"
  388.             BeginProperty Font 
  389.                Name            =   "宋体"
  390.                Size            =   10.5
  391.                Charset         =   134
  392.                Weight          =   400
  393.                Underline       =   0   'False
  394.                Italic          =   0   'False
  395.                Strikethrough   =   0   'False
  396.             EndProperty
  397.             ForeColor       =   &H00000000&
  398.             Height          =   210
  399.             Index           =   2
  400.             Left            =   240
  401.             TabIndex        =   21
  402.             Top             =   2760
  403.             Width           =   840
  404.          End
  405.          Begin VB.Label Label2 
  406.             AutoSize        =   -1  'True
  407.             Caption         =   "借出日期"
  408.             BeginProperty Font 
  409.                Name            =   "宋体"
  410.                Size            =   10.5
  411.                Charset         =   134
  412.                Weight          =   400
  413.                Underline       =   0   'False
  414.                Italic          =   0   'False
  415.                Strikethrough   =   0   'False
  416.             EndProperty
  417.             ForeColor       =   &H00000000&
  418.             Height          =   210
  419.             Index           =   1
  420.             Left            =   240
  421.             TabIndex        =   19
  422.             Top             =   2160
  423.             Width           =   840
  424.          End
  425.          Begin VB.Label Label2 
  426.             AutoSize        =   -1  'True
  427.             Caption         =   "类别"
  428.             BeginProperty Font 
  429.                Name            =   "宋体"
  430.                Size            =   10.5
  431.                Charset         =   134
  432.                Weight          =   400
  433.                Underline       =   0   'False
  434.                Italic          =   0   'False
  435.                Strikethrough   =   0   'False
  436.             EndProperty
  437.             ForeColor       =   &H00000000&
  438.             Height          =   210
  439.             Index           =   0
  440.             Left            =   4920
  441.             TabIndex        =   17
  442.             Top             =   360
  443.             Width           =   420
  444.          End
  445.          Begin VB.Label Label2 
  446.             AutoSize        =   -1  'True
  447.             Caption         =   "今天日期"
  448.             BeginProperty Font 
  449.                Name            =   "宋体"
  450.                Size            =   10.5
  451.                Charset         =   134
  452.                Weight          =   400
  453.                Underline       =   0   'False
  454.                Italic          =   0   'False
  455.                Strikethrough   =   0   'False
  456.             EndProperty
  457.             ForeColor       =   &H00000000&
  458.             Height          =   210
  459.             Index           =   9
  460.             Left            =   2520
  461.             TabIndex        =   12
  462.             Top             =   2160
  463.             Width           =   840
  464.          End
  465.          Begin VB.Label Label2 
  466.             AutoSize        =   -1  'True
  467.             Caption         =   "出版社"
  468.             BeginProperty Font 
  469.                Name            =   "宋体"
  470.                Size            =   10.5
  471.                Charset         =   134
  472.                Weight          =   400
  473.                Underline       =   0   'False
  474.                Italic          =   0   'False
  475.                Strikethrough   =   0   'False
  476.             EndProperty
  477.             ForeColor       =   &H00000000&
  478.             Height          =   210
  479.             Index           =   10
  480.             Left            =   240
  481.             TabIndex        =   11
  482.             Top             =   1560
  483.             Width           =   630
  484.          End
  485.          Begin VB.Label Label2 
  486.             AutoSize        =   -1  'True
  487.             Caption         =   "价格"
  488.             BeginProperty Font 
  489.                Name            =   "宋体"
  490.                Size            =   10.5
  491.                Charset         =   134
  492.                Weight          =   400
  493.                Underline       =   0   'False
  494.                Italic          =   0   'False
  495.                Strikethrough   =   0   'False
  496.             EndProperty
  497.             ForeColor       =   &H00000000&
  498.             Height          =   210
  499.             Index           =   11
  500.             Left            =   3000
  501.             TabIndex        =   10
  502.             Top             =   360
  503.             Width           =   420
  504.          End
  505.          Begin VB.Label Label2 
  506.             AutoSize        =   -1  'True
  507.             Caption         =   "书  名"
  508.             BeginProperty Font 
  509.                Name            =   "宋体"
  510.                Size            =   10.5
  511.                Charset         =   134
  512.                Weight          =   400
  513.                Underline       =   0   'False
  514.                Italic          =   0   'False
  515.                Strikethrough   =   0   'False
  516.             EndProperty
  517.             ForeColor       =   &H00000000&
  518.             Height          =   210
  519.             Index           =   12
  520.             Left            =   240
  521.             TabIndex        =   9
  522.             Top             =   960
  523.             Width           =   630
  524.          End
  525.          Begin VB.Label Label2 
  526.             AutoSize        =   -1  'True
  527.             Caption         =   "图书编号"
  528.             BeginProperty Font 
  529.                Name            =   "宋体"
  530.                Size            =   10.5
  531.                Charset         =   134
  532.                Weight          =   400
  533.                Underline       =   0   'False
  534.                Italic          =   0   'False
  535.                Strikethrough   =   0   'False
  536.             EndProperty
  537.             ForeColor       =   &H00000000&
  538.             Height          =   210
  539.             Index           =   13
  540.             Left            =   240
  541.             TabIndex        =   8
  542.             Top             =   360
  543.             Width           =   840
  544.          End
  545.       End
  546.       Begin VB.CommandButton cmdOkCancel 
  547.          BackColor       =   &H000080FF&
  548.          Caption         =   "归还图书(&C)"
  549.          BeginProperty Font 
  550.             Name            =   "楷体_GB2312"
  551.             Size            =   12
  552.             Charset         =   134
  553.             Weight          =   700
  554.             Underline       =   0   'False
  555.             Italic          =   0   'False
  556.             Strikethrough   =   0   'False
  557.          EndProperty
  558.          Height          =   495
  559.          Index           =   1
  560.          Left            =   5640
  561.          Style           =   1  'Graphical
  562.          TabIndex        =   1
  563.          ToolTipText     =   "归还当前图书"
  564.          Top             =   5280
  565.          Visible         =   0   'False
  566.          Width           =   1695
  567.       End
  568.       Begin VB.Image Image1 
  569.          Height          =   480
  570.          Left            =   120
  571.          Picture         =   "Lentfrm.frx":0CC6
  572.          Top             =   600
  573.          Width           =   480
  574.       End
  575.       Begin VB.Label Label5 
  576.          AutoSize        =   -1  'True
  577.          Caption         =   "输入要还的图书编号"
  578.          BeginProperty Font 
  579.             Name            =   "宋体"
  580.             Size            =   12
  581.             Charset         =   134
  582.             Weight          =   700
  583.             Underline       =   0   'False
  584.             Italic          =   0   'False
  585.             Strikethrough   =   0   'False
  586.          EndProperty
  587.          ForeColor       =   &H000000C0&
  588.          Height          =   240
  589.          Index           =   1
  590.          Left            =   720
  591.          TabIndex        =   16
  592.          Top             =   720
  593.          Width           =   2310
  594.       End
  595.       Begin VB.Label Label4 
  596.          AutoSize        =   -1  'True
  597.          Caption         =   "**<才能归还图书>"
  598.          ForeColor       =   &H00FF0000&
  599.          Height          =   180
  600.          Index           =   2
  601.          Left            =   5280
  602.          TabIndex        =   15
  603.          Top             =   960
  604.          Width           =   1440
  605.       End
  606.       Begin VB.Label Label4 
  607.          AutoSize        =   -1  'True
  608.          Caption         =   "**<输入图书编号后回车>"
  609.          ForeColor       =   &H00FF0000&
  610.          Height          =   180
  611.          Index           =   3
  612.          Left            =   5280
  613.          TabIndex        =   14
  614.          Top             =   720
  615.          Width           =   1980
  616.       End
  617.       Begin VB.Line Line2 
  618.          BorderColor     =   &H8000000D&
  619.          Index           =   1
  620.          X1              =   0
  621.          X2              =   7440
  622.          Y1              =   1320
  623.          Y2              =   1320
  624.       End
  625.    End
  626. End
  627. Attribute VB_Name = "Lentfrm"
  628. Attribute VB_GlobalNameSpace = False
  629. Attribute VB_Creatable = False
  630. Attribute VB_PredeclaredId = True
  631. Attribute VB_Exposed = False
  632. Dim rst2 As Recordset '打开表BookFlag
  633. Dim rst3 As Recordset '打开表Book
  634. Dim rst1 As Recordset '打开表personal
  635. Dim db2 As Database
  636. Dim db3 As Database
  637. Dim db1 As Database
  638. Dim db As Database
  639. Dim rst As Recordset
  640. Private Sub cmdExit_Click()
  641. Unload Me
  642. End Sub
  643. Private Sub cmdOkCancel_Click(Index As Integer)
  644. Select Case Index
  645.     Case 1
  646.         rst2.Seek "=", txtBookBian1.Text
  647.         If rst2.NoMatch Then
  648.             MsgBox "没有借过这本书!是不是编号错了?", 0 + 48, "提示"
  649.             txtBookBian1.Text = ""
  650.             txtBookBian1.SetFocus
  651.             Frame6.Visible = False
  652.             cmdOkCancel(1).Visible = False
  653.             Exit Sub
  654.         End If
  655.         If rst3.Fields("是否借出") = False Then
  656.             MsgBox "此书还没有借出", 0 + 48, "提示"
  657.             Exit Sub
  658.         End If
  659.         rst1.Seek "=", rst2.Fields("借书证号")
  660.         rst1.Edit
  661.         '将罚款金额写入数据库
  662.         rst1.Fields("罚款") = Val(txtFa.Text) + rst1.Fields("罚款")
  663.         rst1.Update
  664.         If txtFa.Text > 0 Then
  665.             MsgBox "罚款金额已经写入数据库!", 0 + 48, "提示"
  666.         End If
  667.         rst2.Delete
  668.         rst3.Edit
  669.         rst3.Fields("是否借出") = False
  670.         rst3.Fields("借出日期") = Empty
  671.         rst3.Update
  672.         txtBookBian1.Text = ""
  673.         txtBookBian1.SetFocus
  674.         Frame6.Visible = False
  675.         cmdOkCancel(1).Visible = False
  676.        ' MsgBox "还书完毕!按回车继续", 0 + 48, "完毕"
  677. End Select
  678. End Sub
  679. Private Sub Form_Load()
  680. Set db2 = Workspaces(0).OpenDatabase("DataBaseData.mdb", False)
  681. Set rst2 = db2.OpenRecordset("BookFf", dbOpenTable)
  682. rst2.Index = "图书编号"
  683. Set db3 = Workspaces(0).OpenDatabase("DataBaseData.mdb", False)
  684. Set rst3 = db3.OpenRecordset("Book", dbOpenTable)
  685. rst3.Index = "图书编号"
  686. Set db1 = Workspaces(0).OpenDatabase("DataBaseData.mdb", False)
  687. Set rst1 = db1.OpenRecordset("Personal", dbOpenTable)
  688. rst1.Index = "借书证号"
  689. Set db = Workspaces(0).OpenDatabase("DatabaseData.mdb", False)
  690. Set rst = db.OpenRecordset("Type", dbOpenTable)
  691. rst.Index = "类别"
  692. txtBookBian1.Text = ""
  693. txtBookhao1.Text = ""
  694. txtBookname1.Text = ""
  695. txtCost1 = ""
  696. txtChuban1 = ""
  697. txtLentDate1 = ""
  698. txtToday = ""
  699. txtType1 = ""
  700. txtLentDay = ""
  701. txtXianDing.Text = ""
  702. txtChaoChu.Text = ""
  703. txtFa.Text = ""
  704. End Sub
  705. Private Sub Form_Unload(Cancel As Integer)
  706. rst2.Close
  707. rst3.Close
  708. rst1.Close
  709. db1.Close
  710. db2.Close
  711. db3.Close
  712. End Sub
  713. Private Sub txtBookBian1_KeyPress(KeyAscii As Integer)
  714. If KeyAscii = 13 Then
  715.     rst3.Seek "=", txtBookBian1.Text
  716.     If rst3.NoMatch Then
  717.         MsgBox "没有此图书编号,请重新填写", 0 + 48, "填写错误"
  718.         txtBookBian1.Text = ""
  719.         'txtBookBian1.SelLength
  720.         txtBookBian1.SetFocus
  721.         Exit Sub
  722.     End If
  723.     Frame6.Visible = True
  724.     cmdOkCancel(1).Visible = True
  725.     txtBookhao1.Text = txtBookBian1.Text
  726.     txtBookname1.Text = rst3.Fields("书名") & vbNullString
  727.     txtChuban1.Text = rst3.Fields("出版社") & vbNullString
  728.     txtCost1.Text = rst3.Fields("价格") & Empty
  729.     txtLentDate1 = rst3.Fields("借出日期") & Empty
  730.     txtToday.Text = Date
  731.     txtType1.Text = rst3.Fields("类别") & vbNullString
  732.     txtLentDay.Text = Date - rst3.Fields("借出日期") & Empty
  733.     rst.Seek "=", rst3.Fields("类别")
  734.     BookDay = rst.Fields("借出天数")
  735.     txtXianDing.Text = BookDay  'BookDay 为限定借出的天数
  736.     If Val(txtLentDay.Text) - BookDay <= 0 Then  '判断是否超出了天数
  737.         txtChaoChu.Text = "未超出"
  738.         txtFa.Text = "0"
  739.         Exit Sub
  740.     Else
  741.         txtChaoChu.Text = Val(txtLentDay.Text) - BookDay
  742.     End If
  743.     txtFa.Text = Format(FaCost * Val(txtChaoChu.Text), "#.00") '计算余额
  744. End If
  745. End Sub