Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  Select Case Button.Index
    Case 2
     If MsgBox("您确定要清屏吗?", vbOKCancel + vbQuestion, "询问") = vbOK Then
      Me.MSFlexGrid1.Clear
      Me.MSFlexGrid1.Cols = 2
      Me.MSFlexGrid1.Rows = 2
      Me.StatusBar1.Panels(1).Text = "总共有0条记录"
     End If
    Case 4
      Call JieShu
    Case 5
      Call HuanShu
    Case 6
      Call XuJie
    Case 8
      Unload Me
  End Select
End Sub
Private Function JieShu()
  Image1.Picture = Image2.Picture
  Label3.Caption = "借"
  Label2.Caption = "书"
  
  Cmd_jhxs.Picture = Image2.Picture
  Cmd_jhxs.Caption = "借出此书"
  
  Me.MSFlexGrid1.Clear
  Me.MSFlexGrid1.Cols = 2
  Me.MSFlexGrid1.Rows = 2
  
  Me.StatusBar1.Panels(1).Text = "总共有0条记录"
  Call PanDuan
End Function
Private Function HuanShu()
  Image1.Picture = Image3.Picture
  Label3.Caption = "还"
  Label2.Caption = "书"
  
  Cmd_jhxs.Picture = Image3.Picture
  Cmd_jhxs.Caption = "归还此书"
  
  Me.MSFlexGrid1.Clear
  Me.MSFlexGrid1.Cols = 2
  Me.MSFlexGrid1.Rows = 2
  
  Me.StatusBar1.Panels(1).Text = "总共有0条记录"
  Call PanDuan
End Function
Private Function XuJie()
  Image1.Picture = Image4.Picture
  Label3.Caption = "续"
  Label2.Caption = "借"
  
  Cmd_jhxs.Picture = Image4.Picture
  Cmd_jhxs.Caption = "续借此书"
  
  Me.MSFlexGrid1.Clear
  Me.MSFlexGrid1.Cols = 2
  Me.MSFlexGrid1.Rows = 2
  
  Me.StatusBar1.Panels(1).Text = "总共有0条记录"
  Call PanDuan
End Function
其中“借书新增”记录和“续借新增”记录界面代码设计如下:
 Private Sub Form_Load()
 Dim sql As String, sql1 As String, sql2 As String
   sql = "select * from 图书借阅"
   ShowData sql, Me.MSFlexGrid1
   Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
  
  Me.Height = 7155
  Me.Width = 8685
  
  Me.Txt_tsid.Text = Frm_jhx.Txt_tsid.Text
  Me.Txt_jszh.Text = Frm_jhx.Txt_jszh.Text
  Me.Txt_jysj.Text = Date
  Me.Txt_czy.Text = yh_login.yhm
  
  Me.Txt_year.Text = year(Date)
  Me.Txt_month.Text = month(Date)
  Me.Txt_day.Text = day(Date)
  
   sql1 = "select 可借书天数,读者类别 from 读者类别 where 读者类别 in(select 读者类别 from 读者信息 where 借书证号='" + Trim(Frm_jhx.Txt_jszh.Text) + "')"
   ShowData sql1, Me.MSFlexGrid2
   
   sql2 = "select * from 图书类型 where 图书类型 in(select 图书类型 from 图书信息 where 图书ID='" + Trim(Frm_jhx.Txt_tsid.Text) + "')"
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页