📄 fbookadd.frm
字号:
VERSION 5.00
Begin VB.Form Fbookaddmodify
Caption = "书目添加修改"
ClientHeight = 5400
ClientLeft = 60
ClientTop = 345
ClientWidth = 5355
LinkTopic = "Form3"
MDIChild = -1 'True
ScaleHeight = 5400
ScaleWidth = 5355
Begin VB.TextBox Tbookid
Height = 495
Left = 2760
TabIndex = 0
Top = 240
Width = 1215
End
Begin VB.TextBox Texist
Height = 495
Left = 2760
TabIndex = 4
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2880
TabIndex = 6
Top = 4440
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1080
TabIndex = 5
Top = 4440
Width = 1215
End
Begin VB.TextBox Tnumber
Height = 495
Left = 2760
TabIndex = 3
Top = 2490
Width = 1215
End
Begin VB.TextBox Tauthorname
Height = 495
Left = 2760
TabIndex = 2
Top = 1740
Width = 1215
End
Begin VB.TextBox Tbookname
Height = 495
Left = 2760
TabIndex = 1
Top = 990
Width = 1215
End
Begin VB.Label Label4
Caption = "书号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 11
Top = 240
Width = 1215
End
Begin VB.Label Label1
Caption = "现存数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 10
Top = 3240
Width = 1215
End
Begin VB.Label Label3
Caption = "册数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 9
Top = 2490
Width = 1215
End
Begin VB.Label Label2
Caption = "作者名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 8
Top = 1740
Width = 1215
End
Begin VB.Label label
Caption = "书名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 7
Top = 990
Width = 1215
End
End
Attribute VB_Name = "Fbookaddmodify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public isadd As Boolean
Private Sub Command1_Click()
Dim strsql As String
If isadd Then
strsql = "insert into books(bookid,bookname,bookauthor,sum,remain) values('" & Trim(Tbookid) & "','" & Trim(Tbookname) & "','" & Trim(Tauthorname) & "','" & Trim(Tnumber) & "','" & Trim(Texist) & "')"
If runsql(strsql) = True Then
Dim lstitem As ListItem
strsql = "select * from books where bookid='" & Tbookid.Text & "'"
runsql (strsql)
Set lstitem = Fbookcheck.lvw1.ListItems.add(, "k_" & Tbookid.Text, Tbookid.Text)
lstitem.SubItems(1) = rct.Fields("bookname").Value
lstitem.SubItems(2) = rct.Fields("bookauthor").Value
lstitem.SubItems(3) = rct.Fields("sum").Value
lstitem.SubItems(4) = rct.Fields("remain").Value
lstitem.Tag = CStr(rct.Fields("bookid").Value)
Unload Me
End If
Else
strsql = "update books set bookid='" & Trim(Tbookid) & "',bookname='" & Trim(Tbookname) & "',bookauthor='" & Trim(Tauthorname) & "',sum='" & Trim(Tnumber) & "',remain='" & Trim(Texist) & "' where bookid= '" & Trim(Tbookid) & "'"
If runsql(strsql) = True Then
strsql = "select * from books where bookid='" & Tbookid.Text & "'"
runsql (strsql)
Fbookcheck.lvw1.SelectedItem.Text = Trim(Tbookid)
Fbookcheck.lvw1.SelectedItem.SubItems(1) = Trim(Tbookname)
Fbookcheck.lvw1.SelectedItem.SubItems(2) = Trim(Tauthorname)
Fbookcheck.lvw1.SelectedItem.SubItems(3) = Trim(Tnumber)
Fbookcheck.lvw1.SelectedItem.SubItems(4) = Trim(Texist)
Unload Me
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
If isadd Then
Me.Caption = "增加书目"
Else
Me.Caption = "修改书目"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -