📄 main_jhgl_sjcx.frm
字号:
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column13
DataField = "经手人"
Caption = "经手人"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column14
DataField = "仓库"
Caption = "仓库"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column15
DataField = "进货票号"
Caption = "进货票号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column16
DataField = "进货日期"
Caption = "进货日期"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column17
DataField = "送检时间"
Caption = "送检时间"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column18
DataField = "试验报告编号"
Caption = "试验报告编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column19
DataField = "试验单位"
Caption = "试验单位"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column20
DataField = "检验和试验结果"
Caption = "检验和试验结果"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column21
DataField = "状态"
Caption = "状态"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1365.165
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 1365.165
EndProperty
BeginProperty Column04
ColumnWidth = 2085.166
EndProperty
BeginProperty Column05
ColumnWidth = 2085.166
EndProperty
BeginProperty Column06
ColumnWidth = 2085.166
EndProperty
BeginProperty Column07
ColumnWidth = 2085.166
EndProperty
BeginProperty Column08
ColumnWidth = 2085.166
EndProperty
BeginProperty Column09
ColumnWidth = 2085.166
EndProperty
BeginProperty Column10
ColumnWidth = 2085.166
EndProperty
BeginProperty Column11
ColumnWidth = 2085.166
EndProperty
BeginProperty Column12
ColumnWidth = 2085.166
EndProperty
BeginProperty Column13
ColumnWidth = 2085.166
EndProperty
BeginProperty Column14
ColumnWidth = 2085.166
EndProperty
BeginProperty Column15
ColumnWidth = 2085.166
EndProperty
BeginProperty Column16
ColumnWidth = 2085.166
EndProperty
BeginProperty Column17
ColumnWidth = 2085.166
EndProperty
BeginProperty Column18
ColumnWidth = 2085.166
EndProperty
BeginProperty Column19
ColumnWidth = 2085.166
EndProperty
BeginProperty Column20
ColumnWidth = 1335.118
EndProperty
BeginProperty Column21
ColumnWidth = 2085.166
EndProperty
EndProperty
End
Begin VB.Frame Frame2
Height = 645
Left = 15
TabIndex = 12
Top = 525
Width = 11490
Begin VB.CheckBox Check1
Height = 270
Index = 1
Left = 120
TabIndex = 16
Top = 240
Width = 255
End
Begin MSComCtl2.DTPicker DTP1
Height = 285
Left = 1245
TabIndex = 13
Top = 225
Width = 3330
_ExtentX = 5874
_ExtentY = 503
_Version = 393216
Format = 19660801
CurrentDate = 38679
End
Begin MSComCtl2.DTPicker DTP2
Height = 285
Left = 5940
TabIndex = 17
Top = 225
Width = 3330
_ExtentX = 5874
_ExtentY = 503
_Version = 393216
Format = 19660801
CurrentDate = 38679
End
Begin VB.Label Label3
Caption = "结束日期"
Height = 210
Left = 4890
TabIndex = 18
Top = 300
Width = 765
End
Begin VB.Label Label2
Caption = "开始日期"
Height = 210
Left = 480
TabIndex = 14
Top = 300
Width = 765
End
End
End
Attribute VB_Name = "main_jhgl_sjcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public selectsql As String
Private Sub cmdEnd_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
selectsql = ""
If text1(0) <> "" Then
If selectsql <> "" Then
selectsql = "物资编号 like +'" + text1(0) + "'+'%'and " & selectsql
Else
selectsql = "物资编号 like +'" + text1(0) + "'+'%'"
End If
End If
If text1(1) <> "" Then
If selectsql <> "" Then
selectsql = "物资名称 like+ '" + text1(1) + "'+'%'and " & selectsql
Else
selectsql = "物资名称 like + '" + text1(1) + "'+'%'"
End If
End If
If text1(2) <> "" Then
If selectsql <> "" Then
selectsql = "规格型号 like+ '" + text1(2) + "'+'%'and " & selectsql
Else
selectsql = "规格型号 like+ '" + text1(2) + "'+'%'"
End If
End If
If text1(3) <> "" Then
If selectsql <> "" Then
selectsql = "批号或炉号 like +'" + text1(3) + "'+'%'and " & selectsql
Else
selectsql = "批号或炉号 like + '" + text1(3) + "'+'%'"
End If
End If
If selectsql <> "" Then
If Check1(0).Value = 1 Then
Adodc1.RecordSource = "select * from tb_rk where " & selectsql & " and 检验和试验结果='无'and 状态='送检'"
Adodc1.Refresh
End If
If Check1(0).Value = 1 And Check1(1).Value = 1 Then
Adodc1.RecordSource = "select * from tb_rk where " & selectsql & " and 送检时间 between '" + Str(DTP1.Value) + "'AND '" + Str(DTP2.Value) + "'and 检验和试验结果='无'and 状态='送检'"
Adodc1.Refresh
End If
Else
If Check1(0).Value = 1 Or Check1(1).Value = 1 Then
Adodc1.RecordSource = "select * from tb_rk where 检验和试验结果='无'and 状态='送检'"
Adodc1.Refresh
End If
If Check1(0).Value = 1 And Check1(1).Value = 1 Then
Adodc1.RecordSource = "select * from tb_rk where 送检时间 between '" + Str(DTP1.Value) + "'AND '" + Str(DTP2.Value) + "'and 检验和试验结果='无'and 状态='送检'"
Adodc1.Refresh
End If
End If
If Check1(1).Value = 1 Then
Adodc1.RecordSource = "select * from tb_rk where 送检时间 between '" + Str(DTP1.Value) + "'AND '" + Str(DTP2.Value) + "'and 检验和试验结果='无'and 状态='送检'"
Adodc1.Refresh
End If
End Sub
Private Sub cmdExport_Click()
Dim i As Integer, j As Integer
Dim ifieldcount As Integer, irecordcount As Integer
Dim wdapp As Word.Application
Dim wddoc As Word.Document
Dim atable As Word.Table
cmdFind_Click
If Adodc1.Recordset.RecordCount > 0 Then
irecordcount = Adodc1.Recordset.RecordCount
'创建word应用程序,这一句话打开word2000
Set wdapp = CreateObject("Word.Application")
'在word中添加一个新文档
Set wddoc = wdapp.Documents.Add
With wdapp
.Visible = True
.Activate
'在word中增加一个表格
.Caption = "送检表"
Set atable = .ActiveDocument.Tables.Add(.Selection.Range, irecordcount + 1, 7)
atable.Cell(1, 1).Range.InsertAfter "物资编号"
atable.Cell(1, 2).Range.InsertAfter "物资名称"
atable.Cell(1, 3).Range.InsertAfter "规格型号"
atable.Cell(1, 4).Range.InsertAfter "批号或炉号"
atable.Cell(1, 5).Range.InsertAfter "送检数量"
atable.Cell(1, 6).Range.InsertAfter "进货日期"
atable.Cell(1, 7).Range.InsertAfter "送检时间"
'指定表格内容
Adodc1.Recordset.MoveFirst
Do Until Adodc1.Recordset.EOF
atable.Cell(DataGrid1.Bookmark + 1, 1).Range.InsertAfter Adodc1.Recordset.Fields("物资编号")
atable.Cell(DataGrid1.Bookmark + 1, 2).Range.InsertAfter Adodc1.Recordset.Fields("物资名称")
atable.Cell(DataGrid1.Bookmark + 1, 3).Range.InsertAfter Adodc1.Recordset.Fields("规格型号")
atable.Cell(DataGrid1.Bookmark + 1, 4).Range.InsertAfter Adodc1.Recordset.Fields("批号或炉号")
atable.Cell(DataGrid1.Bookmark + 1, 5).Range.InsertAfter Adodc1.Recordset.Fields("数量")
atable.Cell(DataGrid1.Bookmark + 1, 6).Range.InsertAfter Adodc1.Recordset.Fields("进货日期")
atable.Cell(DataGrid1.Bookmark + 1, 7).Range.InsertAfter Adodc1.Recordset.Fields("送检时间")
Adodc1.Recordset.MoveNext
Loop
End With
'清除word对象
Set wdapp = Nothing
Set wddoc = Nothing
Else
MsgBox "没有送检物资!", , "提示窗口"
End If
End Sub
Private Sub Form_Load()
Me.Caption = text
cmdFind_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -