📄 数据选择.frm
字号:
TabIndex = 0
Top = 5640
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 5760
Width = 4575
_ExtentX = 8070
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
End
Attribute VB_Name = "数据选择"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2008/05/11
'描 述:天宏钢构仓库管理系统 Ver 2.96
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Public title As String
Public result1 As String
Public result2 As String
Public result3 As String
Public result4 As String '单价的传入值
Private SQL As String
Private 仓库编号 As String
Option Explicit
Private Sub CancelButton_Click()
result1 = ""
result2 = ""
Unload Me
End Sub
Private Sub Command1_Click()
On Error GoTo quit
'获取仓库编号
If Text1.Text <> "" Then
'fMainForm.m_checkado.RecordSource = "select 编号, 货物名称,货物规格,计量单位 from 货物信息 where 货物信息.货物名称 like '%" + Text1.Text + "%'"
fMainForm.m_checkado.RecordSource = "select 库存状况.货物编号,货物信息.货物名称,库存状况.库存数量,货物信息.货物类别,货物信息.货物规格,货物信息.计量单位,货物信息.最低限量,货物信息.最高限量,仓库.仓库名称 as 存放仓库 from 库存状况,货物信息,仓库 where 货物信息.编号=库存状况.货物编号 and 仓库.编号=库存状况.仓库编号 and 货物信息.货物名称 like '%" + Text1.Text + "%'"
fMainForm.m_checkado.Refresh
End If
If Text2.Text <> "" Then
fMainForm.m_checkado.RecordSource = "select 库存状况.货物编号,货物信息.货物名称,库存状况.库存数量,货物信息.货物类别,货物信息.货物规格,货物信息.计量单位,货物信息.最低限量,货物信息.最高限量,仓库.仓库名称 as 存放仓库 from 库存状况,货物信息,仓库 where 货物信息.编号=库存状况.货物编号 and 仓库.编号=库存状况.仓库编号 and 货物信息.货物类别 like '%" + Text2.Text + "%'"
fMainForm.m_checkado.Refresh
End If
If Text3.Text <> "" Then
fMainForm.m_checkado.RecordSource = "select 库存状况.货物编号,货物信息.货物名称,库存状况.库存数量,货物信息.货物类别,货物信息.货物规格,货物信息.计量单位,货物信息.最低限量,货物信息.最高限量,仓库.仓库名称 as 存放仓库 from 库存状况,货物信息,仓库 where 货物信息.编号=库存状况.货物编号 and 仓库.编号=库存状况.仓库编号 and 货物信息.货物规格 like '%" + Text3.Text + "%'"
End If
Adodc1.RecordSource = fMainForm.m_checkado.RecordSource
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
initdatagrid1
quit:
End Sub
Private Sub findcmd_Click()
On Error GoTo quit
'获取仓库编号
If 货物名称.Text <> "" Then
fMainForm.m_checkado.RecordSource = "select 编号, 货物名称,货物规格,计量单位 from 货物信息 where 货物信息.货物名称 like '%" + 货物名称.Text + "%'"
fMainForm.m_checkado.Refresh
End If
If 货物类别.Text <> "" Then
fMainForm.m_checkado.RecordSource = "select 编号,货物名称,货物规格,计量单位 from 货物信息 where 货物信息.货物类别 like '%" + 货物类别.Text + "%'"
fMainForm.m_checkado.Refresh
End If
If 货物规格.Text <> "" Then
fMainForm.m_checkado.RecordSource = "select 编号,货物名称,货物规格,计量单位 from 货物信息 where 货物信息.货物规格 like '%" + 货物规格.Text + "%'"
End If
Adodc1.RecordSource = fMainForm.m_checkado.RecordSource
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
initdatagrid1
quit:
End Sub
Private Sub Form_Activate()
If Me.title = "请选择经办人" Then init13
If Me.title = "请选择客户" Then init13
If Me.title = "请选择存放仓库" Then init13
If Me.title = "请选择供应商" Then init13
If Me.title = "请选择领取部门" Then init13
If Me.title = "请选择借出货物" Then init12
If Me.title = "请选择借入货物" Then init11
If Me.title = "请选择出库货物" Then init12
If Me.title = "请选择入库货物" Then init11
End Sub
Private Sub Form_Load()
Adodc1.Visible = False
End Sub
Private Sub Form_Resize()
On Error Resume Next
Adodc1.ConnectionString = DataConnectString
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Me.caption = title
Dim d As Integer
Dim inttype As Integer
If DataGrid1.Columns.count <= 2 Then
d = 600
Else
d = 50
End If
Dim i As Integer
For i = 0 To DataGrid1.Columns.count - 1
DataGrid1.Columns(i).width = Len(DataGrid1.Columns(i).caption) * d
inttype = Adodc1.Recordset.Fields(i).Type
Select Case inttype
Case dbBoolean
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 500
Case dbByte
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 500
Case dbInteger
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 500
Case dbLong
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 500
Case dbCurrency
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
Case dbSingle
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 600
Case dbDouble
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 700
Case dbDate
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 800
Case dbText
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
Case dbLongBinary
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
Case dbMemo
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
Case dbGUID
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
Case Else
DataGrid1.Columns(i).width = DataGrid1.Columns(i).width + 1000
End Select
Next
End Sub
Private Sub OKButton_Click()
On Error Resume Next
result1 = DataGrid1.Columns(0).Text
result2 = DataGrid1.Columns(1).Text
result3 = DataGrid1.Columns(2).Text
result4 = DataGrid1.Columns(3).Text
Unload Me
End Sub
Private Sub initdatagrid1()
DataGrid1.Columns(0).width = 800
DataGrid1.Columns(1).width = 1600
DataGrid1.Columns(2).width = 1200
DataGrid1.Columns(3).width = 1600
DataGrid1.Columns(4).width = 1200
DataGrid1.Columns(5).width = 800
DataGrid1.Columns(6).width = 1000
DataGrid1.Columns(7).width = 1000
DataGrid1.Columns(8).width = 1000
DataGrid1.Columns(9).width = 1000
End Sub
Private Sub init12()
'隐藏起来入库选择
Frame2.Visible = False
End Sub
Private Sub init11()
'隐藏起来出库选择
Frame1.Visible = False
End Sub
Private Sub init13()
'隐藏起来出库选择
Frame1.Visible = False
Frame2.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -