📄 frmupdate.frm
字号:
Caption = "附 件:"
ForeColor = &H000000C0&
Height = 255
Left = 240
TabIndex = 33
Top = 2010
Width = 975
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "版 次:"
ForeColor = &H00C00000&
Height = 255
Left = 3060
TabIndex = 32
Top = 1395
Width = 975
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "订购金额:"
ForeColor = &H000000C0&
Height = 255
Left = 240
TabIndex = 31
Top = 1710
Width = 975
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "出版日期:"
ForeColor = &H00C00000&
Height = 255
Left = 3060
TabIndex = 30
Top = 1080
Width = 975
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "出 版 社:"
ForeColor = &H00C00000&
Height = 255
Left = 240
TabIndex = 29
Top = 1395
Width = 975
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "类别代码:"
ForeColor = &H00C00000&
Height = 255
Left = 3045
TabIndex = 28
Top = 765
Width = 975
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "作 者:"
ForeColor = &H00C00000&
Height = 255
Left = 240
TabIndex = 27
Top = 1080
Width = 975
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "书籍名称:"
ForeColor = &H00C00000&
Height = 255
Left = 3060
TabIndex = 26
Top = 480
Width = 975
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "类 别:"
ForeColor = &H00C00000&
Height = 255
Left = 240
TabIndex = 25
Top = 765
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "订 购 人:"
ForeColor = &H00C00000&
Height = 255
Left = 240
TabIndex = 24
Top = 480
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "订购日期:"
ForeColor = &H00C00000&
Height = 255
Left = 3060
TabIndex = 23
Top = 195
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "订 单 号:"
ForeColor = &H000000C0&
Height = 255
Left = 240
TabIndex = 22
Top = 195
Width = 975
End
End
Begin VB.CommandButton Command3
Caption = "查 询"
Height = 375
Left = 3960
TabIndex = 4
Top = 3450
Width = 1125
End
Begin VB.CommandButton Command4
Caption = "退 出"
Height = 375
Left = 5160
TabIndex = 3
Top = 3450
Width = 1125
End
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 360
Left = -70180
TabIndex = 2
Top = 3360
Width = 1350
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 360
Left = -71640
TabIndex = 1
Top = 3360
Width = 1305
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 350
Left = 120
TabIndex = 49
Top = 3050
Width = 6250
_ExtentX = 11033
_ExtentY = 635
_Version = 393216
Appearance = 0
Scrolling = 1
End
End
End
Attribute VB_Name = "frmupdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub combo1_Click()
Adodc1.RecordSource = "select * from lbtb where 书籍类别='" & Trim(Combo1.Text) & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text12.Text = Adodc1.Recordset.Fields(2)
End If
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text4.SetFocus
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Combo3.SetFocus
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text14.SetFocus
End Sub
Private Sub Command1_Click()
Dim myval As String
myval = MsgBox("是否验收订单!", vbYesNo + vbOKOnly, "提示")
If myval = vbYes Then
cnn.Execute ("insert into rkb values('" & Text1 & "','" & DTPicker1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & DTPicker2 & "','" & Text6 & "','" & Text7 & "'," & Text8.Text & ",'" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "')")
MsgBox "验收成功!!", , "信息提示"
Adodc2.Refresh
Adodc3.Refresh
Adodc4.RecordSource = "select * from newtb where 订单号='" + Text1 + "' and 是否验收 = '0'"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount > 0 Then
cnn.Execute ("UPDATE newtb SET 是否验收= '1',复本数='" + Text9.Text + "' where 订单号='" + Text1.Text + "'")
Else
End If
rs1.Open "select * from books where 书籍名称='" + Text3 + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
rs1.Fields("复本数") = rs1.Fields("复本数") + Val(Text9.Text)
rs1.Update
Else
cnn.Execute ("insert into books values('" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "'," & Text8.Text & ",'" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "',0)")
End If
rs1.Close
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Dim Counter As Integer
Dim workarea(100) As String
Counter = 0
' On Error Resume Next
ProgressBar1.Value = ProgressBar1.Min
For Counter = LBound(workarea) To UBound(workarea)
If Check1.Value = 1 And Check2.Value = 0 Then
If Combo3.Text = " Like" Then
Adodc3.RecordSource = "select * from rkb where " & Combo2.Text & " like + '%" + Text14.Text + "%'"
Adodc3.Refresh
Else
Adodc3.RecordSource = "select * from rkb where " & Combo2.Text & Combo3 & " + '" + Text14.Text + "'"
Adodc3.Refresh
End If
ElseIf Check1.Value = 0 And Check2.Value = 1 Then
Adodc3.RecordSource = "select * from rkb where 订购日期 between'" & DTPicker3 & "' and '" & DTPicker4 & "'"
' Adodc3.RecordSource = "select * from rkb where 订购日期 between'" + DTPicker3 + "' and '" + DTPicker4 + "'"
Adodc3.Refresh
ElseIf Check1.Value = 1 And Check2.Value = 1 Then
Select Case Combo3.Text
Case Is = " Like"
Adodc3.RecordSource = "select * from rkb where(rkb." & Combo2.Text & " like '%" + Text14.Text + "%'and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
Case Is = " ="
Adodc3.RecordSource = "select * from rkb where (rkb." & Combo2.Text & " = '" + Text14.Text + "' and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
Case Is = " <"
Adodc3.RecordSource = "select * from rkb where (rkb." & Combo2.Text & "< '" + Text14.Text + "' and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
Case Is = " >"
Adodc3.RecordSource = "select * from rkb where (rkb." & Combo2.Text & "> '" + Text14.Text + "' and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
Case Is = " <="
Adodc3.RecordSource = "select * from rkb where (rkb." & Combo2.Text & "<= '" + Text14.Text + "' and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
Case Is = " >="
Adodc3.RecordSource = "select * from rkb where (rkb." & Combo2.Text & ">= '" + Text14.Text + "' and rkb.订购日期 between '" & DTPicker3.Value & "' and '" & DTPicker4.Value & "')"
Adodc3.Refresh
End Select
End If
' If Counter = 100 Then
' Me.MousePointer = 0
' End If
ProgressBar1.Value = Counter
Next Counter
ProgressBar1.Value = ProgressBar1.Min
ProgressBar1.Value = 0
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus
End Sub
Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text6.SetFocus
End Sub
Private Sub DTPicker3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTPicker4.SetFocus
End Sub
Private Sub Form_Load()
Me.Caption = SSTab1.Caption
rs1.Open "lbtb", cnn, adOpenStatic, adLockOptimistic, adCmdTable
If rs1.RecordCount > 0 Then
rs1.MoveFirst
' Do While rs1.EOF = False
' Combo1.AddItem rs1.Fields("书籍类别")
' rs1.MoveNext
' If rs1.EOF Then Exit Do
' Loop
End If
rs1.Close
' DTPicker1.Value = Date
Adodc4.RecordSource = "select * from newtb where 订单号='" + Str + "'"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount > 0 Then
Text1.Text = Adodc4.Recordset.Fields(0)
DTPicker1.Value = Adodc4.Recordset.Fields("订购日期")
Text2.Text = Adodc4.Recordset.Fields(2)
Text3.Text = Adodc4.Recordset.Fields(3)
Text4.Text = Adodc4.Recordset.Fields(4)
Text5.Text = Adodc4.Recordset.Fields(5)
DTPicker2.Value = Adodc4.Recordset.Fields("出版日期")
Text6.Text = Adodc4.Recordset.Fields(7)
Text7.Text = Adodc4.Recordset.Fields(8)
Text8.Text = Adodc4.Recordset.Fields(9)
Text9.Text = Adodc4.Recordset.Fields(10)
Text10.Text = Adodc4.Recordset.Fields(11)
Text11.Text = Adodc4.Recordset.Fields(12)
Text12.Text = Adodc4.Recordset.Fields(13)
Text13.Text = Adodc4.Recordset.Fields(14)
' Combo2.AddItem "订单号"
' Combo2.AddItem "订购人"
' Combo2.AddItem "类别代码"
' Combo2.AddItem "书籍名称"
' Combo2.AddItem "出版社"
' Combo2.AddItem "订购价格"
' Combo2.AddItem "条码号"
' Combo3.AddItem "like"
' Combo3.AddItem "="
' Combo3.AddItem ">"
' Combo3.AddItem "<"
' Combo3.ListIndex = 0
' DTPicker1.Value = Date - 30
' DTPicker2.Value = Date
Else
End If
Adodc1.RecordSource = "select * from lbtb where 类别代码='" + Text4.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Combo1.Text = Adodc1.Recordset.Fields("书籍类别")
Else
End If
End Sub
Sub clear()
Text2.Text = ""
Combo1.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text3.Text = ""
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Me.Caption = SSTab1.Caption
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTPicker1.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Combo1.SetFocus
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text5.SetFocus
End Sub
Private Sub text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTPicker2.SetFocus
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text7.SetFocus
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text8.SetFocus
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text9.SetFocus
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text11.SetFocus
End Sub
Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text12.SetFocus
End Sub
Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text13.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -