📄 singlexg.frm
字号:
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 300
TabIndex = 5
Top = 540
Width = 1155
End
Begin VB.Label Label2
Caption = "为:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
TabIndex = 4
Top = 120
Width = 495
End
Begin VB.Label Label1
Caption = "请选择字段:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 60
TabIndex = 3
Top = 120
Width = 1515
End
End
Attribute VB_Name = "singlexg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Private Sub Command1_Click()
Dim field1 As String
Dim field2 As String
Dim ordstr As String
Dim sqlstr As String
Dim sqllast1 As String
Dim sqllast2 As String
Dim sqllast3 As String
On Error Resume Next
field1 = Combo1.Text
field2 = Combo2.Text
ordstr = Combo3.Text
sqlstr = "select * from 预采数据 "
If Text1.Text = "" Then
sqllast1 = ""
Else
If field1 = "ISBN号" Then sqllast1 = "isbn like '" & Text1.Text & "*'"
If field1 = "书 名" Then sqllast1 = "bookname like '*" & Text1.Text & "*'"
If field1 = "作 者" Then sqllast1 = "author like '*" & Text1.Text & "*'"
If field1 = "出版社" Then sqllast1 = "bms like '*" & Text1.Text & "*'"
If field1 = "出版年" Then sqllast1 = "bmn like '*" & Text1.Text & "*'"
If field1 = "提供商" Then sqllast1 = "provide like '*" & Text1.Text & "*'"
sqlstr = sqlstr & " where " & sqllast1
End If
If Text2.Text = "" Then
sqllast2 = ""
Else
If field2 = "ISBN号" Then sqllast2 = "isbn like '" & Text2.Text & "*'"
If field2 = "书 名" Then sqllast2 = "bookname like '*" & Text2.Text & "*'"
If field2 = "作 者" Then sqllast2 = "author like '*" & Text2.Text & "*'"
If field2 = "出版社" Then sqllast2 = "bms like '*" & Text2.Text & "*'"
If field2 = "出版年" Then sqllast2 = "bmn like '*" & Text2.Text & "*'"
If field2 = "提供商" Then sqllast2 = "provide like '*" & Text1.Text & "*'"
If Text1.Text = "" Then
sqlstr = sqlstr & " where " & sqllast2
Else
sqlstr = sqlstr & " and " & sqllast2
End If
End If
If ordstr = "控制号" Then sqllast3 = "order by ID"
If ordstr = "ISBN号" Then sqllast3 = "order by isbn"
If ordstr = "书 名" Then sqllast3 = "order by bookname"
If ordstr = "作 者" Then sqllast3 = "order by author"
If ordstr = "出版社" Then sqllast3 = "order by bms"
If ordstr = "出版年" Then sqllast3 = "order by bmn"
If ordstr = "价 格" Then sqllast3 = "order by jg desc"
If ordstr = "选书数" Then sqllast3 = "order by fbl desc"
If ordstr = "时 间" Then sqllast3 = "order by modidate desc"
sqlstr = sqlstr & " " & sqllast3
'MsgBox sqlstr
Data3.RecordSource = sqlstr
Data3.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
'图书扫描选购,两种情况:提示与不提示。
Dim checknum As Integer
Dim dcnum As Integer
checknum = 0
dcnum = 0 '典藏
dcnum = Check2.Value
On Error Resume Next
Data3.RecordSource = "select * from 预采数据 where fbl>0 order by modidate desc"
Data3.Refresh
' Data3.Recordset.MoveLast
If Text1.Text = "" Then Exit Sub
If Combo1.Text <> "ISBN号" Then Exit Sub
checknum = Check1.Value
isbntext = isbndel(Text1.Text)
sqlstr = "select * from 预采数据 where isbn='" & isbntext & "'"
Data1.RecordSource = sqlstr
Data1.Refresh
topint = Data1.Recordset.RecordCount '预采数据查重
If singleanddc = "single" Then
If botint >= 1 Then
If checknum = 0 Then
' MsgBox "与馆藏重复,未选!", vbOKOnly
'加声音:馆藏重复,未选
sndPlaySound "d:\tscg\wav\hggc.wav", SND_SYNC
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
Exit Sub
Else
'显示提示框:是否选购
excelnew.Show 1
If botyn = 7 Then
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
Exit Sub
End If
End If
End If
End If
If topint = 0 Then
Data3.Recordset.AddNew
Data3.Recordset.Fields("isbn") = isbntext
Data3.Recordset.Fields("bookname") = ""
Data3.Recordset.Fields("author") = ""
Data3.Recordset.Fields("bms") = ""
Data3.Recordset.Fields("bmn") = ""
Data3.Recordset.Fields("modidate") = Now()
If Check2.Value = 1 Then
Data3.Recordset.Fields("bjh") = Text4.Text
End If
Data3.Recordset.Fields("jg") = 0
Data3.Recordset.Fields("fbl") = Str(Text3.Text)
Data3.Recordset.Update
'MsgBox "选书成功", vbOKOnly
'加声音:选书成功
sndPlaySound "d:\tscg\wav\hgcg.wav", SND_SYNC
Data3.Refresh
Data3.Recordset.MoveFirst
Else
If Data1.Recordset.Fields("fbl").Value = 0 Then
Data1.Recordset.MoveFirst
Data1.Recordset.Edit
Data1.Recordset.Fields("fbl") = Str(Text3.Text)
Data1.Recordset.Fields("modidate") = Now()
If Check2.Value = 1 Then
Data1.Recordset.Fields("bjh") = Text4.Text
End If
Data1.Recordset.Update
Data3.Refresh
Data3.Recordset.FindFirst ("isbn='" & isbntext & "'")
sndPlaySound "d:\tscg\wav\hgcg.wav", SND_SYNC
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
Exit Sub
End If
If checknum = 1 Then
rexg = 0
diagcx.Show 1
If rexg = 0 Then
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
Exit Sub
End If
End If
' MsgBox "选过,重选", vbOKOnly
'加声音:选过,重选
If Check2.Value <> 1 Then
Data1.Recordset.MoveFirst
Data1.Recordset.Edit
Data1.Recordset.Fields("fbl") = Str(Text3.Text)
Data1.Recordset.Fields("modidate") = Now()
Data1.Recordset.Update
sndPlaySound "d:\tscg\wav\hgcx.wav", SND_SYNC
Else
Data1.Recordset.MoveFirst
Data1.Recordset.Edit
'Data1.Recordset.Fields("fbl") = Str(Text3.Text)
Data1.Recordset.Fields("modidate") = Now()
Data1.Recordset.Update
sndPlaySound "d:\tscg\wav\hgxg.wav", SND_SYNC
End If
Data3.Refresh
Data3.Recordset.FindFirst ("isbn='" & isbntext & "'")
End If
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
End Sub
Private Sub Command4_Click()
On Error Resume Next
If Check2.Value = 1 Then
Data3.Recordset.Edit
Data3.Recordset.Fields("class").Value = "高等"
Data3.Recordset.Fields("modidate") = Now()
Data3.Recordset.Update
End If
' Data3.Refresh
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
End Sub
Private Sub Command5_Click()
On Error Resume Next
If Check2.Value = 1 Then
Data3.Recordset.Edit
Data3.Recordset.Fields("class").Value = "高职"
Data3.Recordset.Fields("modidate") = Now()
Data3.Recordset.Update
End If
' Data3.Refresh
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
End Sub
Private Sub Command6_Click()
On Error Resume Next
If Check2.Value = 1 Then
Data3.Recordset.Edit
Data3.Recordset.Fields("class").Value = "中专"
Data3.Recordset.Fields("modidate") = Now()
Data3.Recordset.Update
End If
' Data3.Refresh
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 20
End Sub
Private Sub Data3_Reposition()
Dim isbnstr As String
On Error GoTo aa
isbnstr = Data3.Recordset.Fields("isbn").Value
Data2.RecordSource = "select * from 本馆数据 where isbn='" & isbnstr & "'"
Data2.Refresh
Exit Sub
aa:
Data2.RecordSource = "select * from 本馆数据 where isbn='abcdefghijklmn'"
Data2.Refresh
End Sub
Private Sub DBGrid1_DblClick()
On Error Resume Next
dispdetail.Text1.Text = Data3.Recordset.Fields("isbn").Value
dispdetail.Text2.Text = Data3.Recordset.Fields("bookname").Value
dispdetail.Text3.Text = Data3.Recordset.Fields("bmn").Value
dispdetail.Text4.Text = Data3.Recordset.Fields("jg").Value
dispdetail.Text5.Text = Data3.Recordset.Fields("bms").Value
dispdetail.Text6.Text = Data3.Recordset.Fields("author").Value
dispdetail.Text7.Text = Data1.Recordset.Fields("fbl").Value
dispdetail.Text8.Text = Data3.Recordset.Fields("context").Value
dispdetail.Text9.Text = Data3.Recordset.Fields("provide").Value
dispdetail.Text10.Text = Data3.Recordset.Fields("bjh").Value
dispdetail.Text11.Text = Data3.Recordset.Fields("class").Value
dispdetail.Text12.Text = Data3.Recordset.Fields("kanben").Value
dispdetail.Text13.Text = Data3.Recordset.Fields("pagenum").Value
dispdetail.Text14.Text = Data3.Recordset.Fields("marcrecordnum").Value
dispdetail.Show 1
End Sub
Private Sub Form_Load()
Me.Top = 0
If singleanddc = "single" Then
Check2.Visible = False
Check2.Value = 0
Label8.Visible = False
Check1.Visible = True
Me.Caption = "图书单选"
Label7.Visible = False
Text4.Visible = False
Command4.Visible = False
Command5.Visible = False
Command6.Visible = False
End If
If singleanddc = "diancang" Then
Check1.Visible = False
Check2.Visible = False
Check2.Value = 1
Check1.Value = 0
Label8.Visible = False
Me.Caption = "数据典藏"
Label7.Visible = True
Text4.Visible = True
Command4.Visible = True
Command5.Visible = True
Command6.Visible = True
End If
Combo2.Text = "书 名"
Combo1.Text = "ISBN号"
Combo3.Text = "控制号"
Data3.RecordSource = "select * from 预采数据 where fbl>0 order by modidate desc"
Data3.Refresh
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then '回车
Call Command3_Click '选购
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -