?? main_rcyw_tsrk.frm
字號:
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ComboBox Combo1
Height = 300
Left = 6630
TabIndex = 14
Top = 1245
Visible = 0 'False
Width = 1110
End
Begin VB.Frame Frame3
Height = 645
Left = 5325
TabIndex = 3
Top = 405
Width = 5715
Begin VB.Label rq
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 3900
TabIndex = 16
Top = 255
Width = 1185
End
Begin VB.Label PH
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 900
TabIndex = 15
Top = 255
Width = 1905
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "票 號: 入庫日期:"
Height = 180
Left = 105
TabIndex = 4
Top = 270
Width = 4890
End
End
Begin VB.Frame Frame2
Height = 645
Left = 15
TabIndex = 1
Top = 405
Width = 5340
Begin VB.TextBox jsr
BackColor = &H00FFFFFF&
Height = 270
Left = 975
TabIndex = 22
Top = 240
Width = 2580
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = " 經(jīng)手人:"
ForeColor = &H00000000&
Height = 255
Left = 105
TabIndex = 2
Top = 285
Width = 840
End
End
Begin VB.TextBox text1
BackColor = &H00C0C0FF&
BorderStyle = 0 'None
Height = 210
Left = 375
TabIndex = 0
Top = 1395
Visible = 0 'False
Width = 1485
End
Begin MSFlexGridLib.MSFlexGrid MS1
Height = 3630
Left = 45
TabIndex = 6
Top = 1065
Width = 11055
_ExtentX = 19500
_ExtentY = 6403
_Version = 393216
BackColorFixed = -2147483636
BackColorBkg = 16777215
ScrollBars = 2
End
Begin VB.Frame Frame4
Height = 645
Left = 15
TabIndex = 7
Top = 4680
Width = 5730
Begin VB.Label hjje
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 210
Left = 4140
TabIndex = 19
Top = 270
Width = 1245
End
Begin VB.Label hjsl
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 2370
TabIndex = 18
Top = 270
Width = 840
End
Begin VB.Label pz
BackStyle = 0 'Transparent
ForeColor = &H0000FF00&
Height = 210
Left = 930
TabIndex = 17
Top = 270
Width = 585
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "入庫品種: 合計數(shù)量: 合計金額: 元"
Height = 315
Left = 75
TabIndex = 8
Top = 285
Width = 5625
End
End
Begin VB.Frame Frame5
Height = 645
Left = 5715
TabIndex = 9
Top = 4680
Width = 5325
Begin VB.CommandButton CmdReg
BackColor = &H00FF8080&
Caption = "&D 登記"
Height = 390
Left = 150
Picture = "main_rcyw_tsrk.frx":0457
TabIndex = 13
Top = 180
Width = 1200
End
Begin VB.CommandButton CmdSave
BackColor = &H00C0C0C0&
Caption = "&S 保存"
Enabled = 0 'False
Height = 390
Left = 1425
Picture = "main_rcyw_tsrk.frx":1635
TabIndex = 12
Top = 180
Width = 1200
End
Begin VB.CommandButton CmdCancel
BackColor = &H00FF8080&
Caption = "&C 取消"
Enabled = 0 'False
Height = 390
Left = 2700
Picture = "main_rcyw_tsrk.frx":2813
TabIndex = 11
Top = 180
Width = 1200
End
Begin VB.CommandButton CmdEnd
BackColor = &H00FF8080&
Caption = "&E 退出"
Height = 390
Left = 3975
Picture = "main_rcyw_tsrk.frx":39F1
TabIndex = 10
Top = 180
Width = 1200
End
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "圖 書 入 庫 憑 證"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Index = 0
Left = 4320
TabIndex = 20
Top = 90
Width = 2655
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "圖 書 入 庫 憑 證"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 1
Left = 4290
TabIndex = 5
Top = 90
Width = 2655
End
End
Attribute VB_Name = "main_rcyw_tsrk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim s, Y, i '聲明變量
'聲明數(shù)據(jù)集對象
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim lsph As Integer '聲明一個整型變量
Private Sub Form_Load()
'定義MS1表的行數(shù)、列數(shù)
MS1.Rows = 102
MS1.Cols = 12
'定義MS1表的列寬和表頭信息
s = Array("300", "800", "700", "2600", "800", "700", "1000", "800", "800", "600", "800", "800", "800")
Y = Array("xh", "書號", "條形碼", "書名", "作者", "出版社", "版 次", "類別", "存放位置", "單價", "入庫數(shù)量", "金額")
For i = 0 To 11
MS1.ColWidth(i) = s(i)
MS1.TextMatrix(0, i) = Y(i)
Next i
'定義MS1表的行號
For i = 1 To 101
MS1.TextMatrix(i, 0) = i
Next i
rq.Caption = Date '設(shè)置入庫日期
'添加圖書類別列表
Set rs1 = New ADODB.Recordset
rs1.Open "select 類別名稱 from tslbb group by 類別名稱", Cnn, adOpenKeyset, adLockOptimistic
If rs1.BOF = False Then rs1.MoveFirst
For i = 0 To rs1.RecordCount - 1
Combo1.AddItem (Trim(rs1.Fields("類別名稱")))
rs1.MoveNext
Next i
rs1.Close
'添加圖書存放位置列表
Set rs2 = New ADODB.Recordset
rs2.Open "select 存放位置 from tswzb group by 存放位置", Cnn, adOpenKeyset, adLockOptimistic
If rs2.BOF = False Then rs2.MoveFirst
For i = 0 To rs2.RecordCount - 1
Combo2.AddItem (Trim(rs2.Fields("存放位置")))
rs2.MoveNext
Next i
rs2.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
MS1.text = Combo1.text
Combo1.Visible = False
MS1.Col = 8
Combo2.Visible = True
Combo2.Width = MS1.CellWidth
Combo2.Left = MS1.CellLeft + MS1.Left
Combo2.Top = MS1.CellTop + MS1.Top
Combo2.SetFocus
End If
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
MS1.text = Combo2.text
Combo2.Visible = False
MS1.Col = 9
Text1.Visible = True
Text1.SetFocus
End If
End Sub
Private Sub grid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then '當(dāng)按回車鍵時
With Adodc1.Recordset
If .RecordCount > 0 Then
If .Fields("書號") <> "" Then
'賦值給MS1表格
If .Fields("書號") <> "" Then MS1.TextMatrix(MS1.Row, 1) = .Fields("書號")
If .Fields("條形碼") <> "" Then MS1.TextMatrix(MS1.Row, 2) = .Fields("條形碼")
If .Fields("書名") <> "" Then MS1.TextMatrix(MS1.Row, 3) = .Fields("書名")
If .Fields("作者") <> "" Then MS1.TextMatrix(MS1.Row, 4) = .Fields("作者")
If .Fields("出版社") <> "" Then MS1.TextMatrix(MS1.Row, 5) = .Fields("出版社")
If .Fields("圖書類別") <> "" Then MS1.TextMatrix(MS1.Row, 7) = .Fields("圖書類別")
If .Fields("存放位置") <> "" Then MS1.TextMatrix(MS1.Row, 8) = .Fields("存放位置")
If .Fields("單價") <> "" Then MS1.TextMatrix(MS1.Row, 9) = .Fields("單價")
Text1.text = MS1.text
Text1.SetFocus
MS1.Col = 5 '到達(dá)第6列
Grid1.Visible = False
Else
MsgBox ("庫存沒有圖書信息可供選擇!")
Grid1.Visible = False 'grid1不可見
Text1.SetFocus
End If
End If
End With
Text1.SetFocus 'text1獲得焦點
End If
If KeyCode = vbKeyEscape Then '按ESC鍵
Grid1.Visible = False 'grid1不可見
Text1.SetFocus 'text1獲得焦點
End If
End Sub
Private Sub jsr_GotFocus()
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -