📄 frmruk.frm
字号:
VERSION 5.00
Begin VB.Form Frmruk
BackColor = &H0080FF80&
Caption = "器材入库查询"
ClientHeight = 3375
ClientLeft = 60
ClientTop = 345
ClientWidth = 6405
LinkTopic = "Form2"
ScaleHeight = 3375
ScaleWidth = 6405
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command6
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 15
Top = 2760
Width = 735
End
Begin VB.CommandButton Command5
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 14
Top = 2280
Width = 735
End
Begin VB.CommandButton Command4
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 13
Top = 1800
Width = 735
End
Begin VB.CommandButton Command3
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 12
Top = 1320
Width = 735
End
Begin VB.CommandButton Command2
Caption = "查询"
Height = 375
Left = 5160
TabIndex = 11
Top = 840
Width = 735
End
Begin VB.TextBox Text5
Height = 375
Left = 2160
TabIndex = 5
Top = 2760
Width = 2775
End
Begin VB.TextBox Text4
Height = 375
Left = 2160
TabIndex = 4
Top = 2280
Width = 2775
End
Begin VB.TextBox Text3
Height = 375
Left = 2160
TabIndex = 3
Top = 1800
Width = 2775
End
Begin VB.TextBox Text2
Height = 375
Left = 2160
TabIndex = 2
Top = 1320
Width = 2775
End
Begin VB.TextBox Text1
Height = 375
Left = 2160
TabIndex = 1
Top = 840
Width = 2775
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "按入库时间查询:"
Height = 495
Left = 480
TabIndex = 10
Top = 2400
Width = 1575
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "按器材名称查询:"
Height = 255
Left = 480
TabIndex = 9
Top = 1440
Width = 1575
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "按操作员查询:"
Height = 495
Left = 720
TabIndex = 8
Top = 2880
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "按供货单位查询:"
Height = 495
Left = 480
TabIndex = 7
Top = 1920
Width = 1815
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "按器材代码查询:"
Height = 375
Left = 480
TabIndex = 6
Top = 960
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "器材入库查询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 1920
TabIndex = 0
Top = 240
Width = 3015
End
End
Attribute VB_Name = "Frmruk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Command2_Click()
Dim cn As New ADODB.Connection '定义连接对象
frmrukugl.Show
Dim rs As New ADODB.Recordset '定义记录集对象
Dim strCnn As String '定义字符串变量
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
Set cn = New ADODB.Connection
cn.Open strCnn
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockBatchOptimistic
rs.Open "select * from qcml where qcdm='" & Text1.Text & "'", cn, , , 0
If (rs.BOF And rs.EOF) Then
MsgBox ("请输入数据或新添加数据!")
'Unload Me
Exit Sub
End If
With frmrukugl
.Text1.Text = rs.Fields(0)
.Text2.Text = rs.Fields(1)
.Text3.Text = rs.Fields(2)
.Text4.Text = rs.Fields(3)
.Text5.Text = rs.Fields(4) & ""
.Text6.Text = rs.Fields(5) & ""
.Text8.Text = rs.Fields(6) & ""
.Text7.Text = rs.Fields(9) & ""
.Text9.Text = rs.Fields(8) & ""
.Text10.Text = rs.Fields(10) & ""
.Text11.Text = rs.Fields(7) & ""
End With
' Text1(2).Text = rs.Fields(2)
Text1.Text = ""
rs.Close
cn.Close
End Sub
Private Sub Command3_Click()
Dim cn As New ADODB.Connection '定义连接对象
frmrukugl.Show
Dim rs As New ADODB.Recordset '定义记录集对象
Dim strCnn As String '定义字符串变量
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
Set cn = New ADODB.Connection
cn.Open strCnn
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockBatchOptimistic
rs.Open "select * from qcml where mc='" & Text.Text2 & "'", cn, , , 0
If (rs.BOF And rs.EOF) Then
MsgBox ("请输入数据或新添加数据!")
'Unload Me
Exit Sub
End If
With frmrukugl
.Text1.Text = rs.Fields(0)
.Text2.Text = rs.Fields(1)
.Text3.Text = rs.Fields(2)
.Text4.Text = rs.Fields(3)
.Text5.Text = rs.Fields(4) & ""
.Text6.Text = rs.Fields(5) & ""
.Text8.Text = rs.Fields(6) & ""
.Text7.Text = rs.Fields(9) & ""
.Text9.Text = rs.Fields(8) & ""
.Text10.Text = rs.Fields(10) & ""
.Text11.Text = rs.Fields(7) & ""
End With
' Text1(2).Text = rs.Fields(2)
Text2.Text = ""
rs.Close
cn.Close
End Sub
Private Sub Command4_Click()
Dim cn As New ADODB.Connection '定义连接对象
frmrukugl.Show
Dim rs As New ADODB.Recordset '定义记录集对象
Dim strCnn As String '定义字符串变量
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
Set cn = New ADODB.Connection
cn.Open strCnn
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockBatchOptimistic
rs.Open "select * from qcml where 供货单位='" & Text3.Text & "'", cn, , , 0
If (rs.BOF And rs.EOF) Then
MsgBox ("请输入数据或新添加数据!")
'Unload Me
Exit Sub
End If
With frmrukugl
.Text1.Text = rs.Fields(0)
.Text2.Text = rs.Fields(1)
.Text3.Text = rs.Fields(2)
.Text4.Text = rs.Fields(3)
.Text5.Text = rs.Fields(4) & ""
.Text6.Text = rs.Fields(5) & ""
.Text8.Text = rs.Fields(6) & ""
.Text7.Text = rs.Fields(9) & ""
.Text9.Text = rs.Fields(8) & ""
.Text10.Text = rs.Fields(10) & ""
.Text11.Text = rs.Fields(7) & ""
End With
' Text1(2).Text = rs.Fields(2)
Text3.Text = ""
rs.Close
cn.Close
End Sub
Private Sub Command5_Click()
Dim cn As New ADODB.Connection '定义连接对象
frmrukugl.Show
Dim rs As New ADODB.Recordset '定义记录集对象
Dim strCnn As String '定义字符串变量
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
Set cn = New ADODB.Connection
cn.Open strCnn
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockBatchOptimistic
rs.Open "select * from qcml where 年='" & Text4.Text & "'", cn, , , 0
If (rs.BOF And rs.EOF) Then
MsgBox ("请输入数据或新添加数据!")
'Unload Me
Exit Sub
End If
With frmrukugl
.Text1.Text = rs.Fields(0)
.Text2.Text = rs.Fields(1)
.Text3.Text = rs.Fields(2)
.Text4.Text = rs.Fields(3)
.Text5.Text = rs.Fields(4) & ""
.Text6.Text = rs.Fields(5) & ""
.Text8.Text = rs.Fields(6) & ""
.Text7.Text = rs.Fields(9) & ""
.Text9.Text = rs.Fields(8) & ""
.Text10.Text = rs.Fields(10) & ""
.Text11.Text = rs.Fields(7) & ""
End With
' Text1(2).Text = rs.Fields(2)
Text4.Text = ""
rs.Close
cn.Close
End Sub
Private Sub Command6_Click()
Dim cn As New ADODB.Connection '定义连接对象
frmrukugl.Show
Dim rs As New ADODB.Recordset '定义记录集对象
Dim strCnn As String '定义字符串变量
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
Set cn = New ADODB.Connection
cn.Open strCnn
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockBatchOptimistic
rs.Open "select * from qcml where 操作员='" & Text5.Text & "'", cn, , , 0
If (rs.BOF And rs.EOF) Then
MsgBox ("请输入数据或新添加数据!")
'Unload Me
Exit Sub
End If
With frmrukugl
.Text1.Text = rs.Fields(0)
.Text2.Text = rs.Fields(1)
.Text3.Text = rs.Fields(2)
.Text4.Text = rs.Fields(3)
.Text5.Text = rs.Fields(4) & ""
.Text6.Text = rs.Fields(5) & ""
.Text8.Text = rs.Fields(6) & ""
.Text7.Text = rs.Fields(9) & ""
.Text9.Text = rs.Fields(8) & ""
.Text10.Text = rs.Fields(10) & ""
.Text11.Text = rs.Fields(7) & ""
End With
' Text1(2).Text = rs.Fields(2)
Text5.Text = ""
rs.Close
cn.Close
End Sub
Private Sub Command7_Click()
Form3.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -