Private Sub Form_Resize()
UpDown1.Value = Int(Txt_xjcs.Text) - 1
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sql As String, sql1 As String, sql2 As String, sql3 As String, rtn As Long
Select Case Button.Index
Case 3
If Trim(Txt_jybh.Text) = "" Then
MsgBox "请填写借阅编号!", vbOKOnly + vbInformation, "提示"
Exit Sub
End If
sql = "insert into 图书借阅 values('" + Trim(Txt_jybh.Text) + "','" + Trim(Txt_tsid.Text) + "','" _
+ Trim(Txt_jszh.Text) + "','" + Trim(Txt_jysj.Text) + "','" + Trim(Txt_yhsj.Text) + "','" _
+ Trim(Txt_czy.Text) + "','" + Trim(Txt_xjcs.Text) + "','" + Trim(Txt_bz.Text) + "')"
rtn = Update(sql)
If rtn = 0 Then
MsgBox "借书成功!", vbOKOnly + vbInformation, "信息"
sql = "select 状态,现存量,借出量 from 图书信息 where 图书ID='" + Me.Txt_tsid.Text + "'"
ShowData sql, Me.MSFlexGrid2
sql1 = "update 图书信息 set 现存量='" & (Int(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 1)) - 1) & "',借出量='" _
& (Int(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 2)) + 1) & "' where 图书ID='" + Me.Txt_tsid.Text + "'"
Update (sql1)
Me.MSFlexGrid2.Clear
Me.MSFlexGrid2.Cols = 2
Me.MSFlexGrid2.Rows = 2
sql2 = "select 状态,现存量 from 图书信息 where 图书ID='" + Me.Txt_tsid.Text + "'"
ShowData sql, Me.MSFlexGrid2
If Trim(Me.MSFlexGrid2.TextMatrix(Me.MSFlexGrid2.Row, 1)) = 0 Then
sql3 = "update 图书信息 set 状态='借出' where 图书ID='" + Me.Txt_tsid.Text + "'"
Update (sql3)
End If
Me.MSFlexGrid2.Clear
Me.MSFlexGrid2.Cols = 2
Me.MSFlexGrid2.Rows = 2
ElseIf rtn = -2147217873 Then
MsgBox "借阅编号已存在!请重新输入!"
Txt_jybh.Text = ""
Txt_jybh.SetFocus
ElseIf rtn = -2147217833 Then
MsgBox "输入信息超过指定长度!请重新输入!"
ElseIf rtn = -2147217900 Then
MsgBox "请不要输入单引号等非法字符!"
Else
MsgBox "出现系统错误!请重启本系统!"
End If
Case 5
sql = "select * from 图书借阅"
ShowData sql, Me.MSFlexGrid1
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
sql1 = "select * from 图书借阅 where 借书证号='" + Frm_jhx.Txt_jszh.Text + "'"
ShowData sql1, Frm_jhx.MSFlexGrid1
Frm_jhx.StatusBar1.Panels(1).Text = "总共有" & Frm_jhx.MSFlexGrid1.Rows - 1 & "条记录"
Case 7
Unload Me
End Select
End Sub
Private Sub UpDown1_Change()
Txt_xjcs.Text = UpDown1.Value + 1
End Sub
Private Function RiQi()
Dim day As Integer, day1 As Integer
Dim month As Integer, month1 As Integer
Dim year As Integer
Select Case Int(Me.Txt_month.Text)
Case 1, 3, 5, 7, 8, 10, 12
day = Int(Me.Txt_day.Text) + Int(Me.Txt_zeng.Text)
If day > 31 Then
day1 = day Mod 31
month = Int(Me.Txt_month.Text) + day \ 31
Me.Txt_day1.Text = day1
Me.Txt_month1.Text = month
Else
Me.Txt_day1.Text = day
Exit Function
End If
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页