📄 form57.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form57
BorderStyle = 0 'None
Caption = "Form57"
ClientHeight = 8010
ClientLeft = 0
ClientTop = 0
ClientWidth = 12165
LinkTopic = "Form57"
Picture = "Form57.frx":0000
ScaleHeight = 8010
ScaleWidth = 12165
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo2
Appearance = 0 'Flat
Height = 300
Left = 3960
TabIndex = 4
Text = "Like"
Top = 360
Width = 1935
End
Begin VB.CommandButton Command2
Appearance = 0 'Flat
Caption = "取消"
Height = 300
Left = 10920
Picture = "Form57.frx":2C55
Style = 1 'Graphical
TabIndex = 3
Top = 360
Width = 735
End
Begin VB.CommandButton Command1
Appearance = 0 'Flat
Caption = "查询"
Height = 300
Left = 9600
Picture = "Form57.frx":3DF9
Style = 1 'Graphical
TabIndex = 2
Top = 360
Width = 735
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 300
Left = 6840
TabIndex = 1
Top = 360
Width = 2055
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
Height = 300
Left = 840
TabIndex = 0
Top = 360
Width = 2175
End
Begin MSComctlLib.ListView ListView1
Height = 6615
Left = 0
TabIndex = 9
Top = 960
Width = 12045
_ExtentX = 21246
_ExtentY = 11668
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
Checkboxes = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
_Version = 393217
ForeColor = 0
BackColor = 16777215
BorderStyle = 1
Appearance = 0
NumItems = 6
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = " 工程编号"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 1
Text = "工程名称"
Object.Width = 3706
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 2
Text = "合同额"
Object.Width = 3175
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 3
Text = "下拨合计"
Object.Width = 3175
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 4
Text = "结算员"
Object.Width = 2600
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 5
Text = "结算时间"
Object.Width = 3176
EndProperty
Picture = "Form57.frx":4F9D
End
Begin VB.Label Label5
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 375
Left = 0
TabIndex = 8
Top = 7680
Width = 11175
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "内容:"
ForeColor = &H00FF0000&
Height = 375
Left = 6240
TabIndex = 7
Top = 480
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "条件:"
ForeColor = &H00FF0000&
Height = 375
Left = 3360
TabIndex = 6
Top = 480
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "项目:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 5
Top = 480
Width = 855
End
End
Attribute VB_Name = "Form57"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i, j As Integer
Dim sqlstring As String
Static l As Integer
If Combo1 = "" Or Combo2 = "" Or Text1 = "" Then
MsgBox "表达式不正确", vbInformation, "提示框!"
Exit Sub
End If
ListView1.ListItems.Clear
sqlstring = "SELECT * FROM 勘察工程任务结算单 WHERE " & Combo1 & " " & Combo2 & " '%" & Text1 & "%'"
hzrs.Open sqlstring, hzconn
l = 0
For i = 1 To hzrs.RecordCount
l = l + 1
Form57.ListView1.ListItems.Add , , hzrs.Fields(1).Value
Form57.ListView1.ListItems.Item(l).SubItems(1) = hzrs.Fields(2).Value
Form57.ListView1.ListItems.Item(l).SubItems(2) = hzrs.Fields(6).Value
Form57.ListView1.ListItems.Item(l).SubItems(3) = hzrs.Fields(75).Value
Form57.ListView1.ListItems.Item(l).SubItems(4) = hzrs.Fields(42).Value
Form57.ListView1.ListItems.Item(l).SubItems(5) = hzrs.Fields(50).Value
hzrs.MoveNext
Next
hzrs.Close
If l <> 0 Then
Form57.Label5.Caption = " 共有" & l & "记录满足查询条件"
Else
MsgBox "没有查询的内容", vbInformation, "提示框!"
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i, j, l, m, o As Integer
With Me
.Height = 8010
.left = 2332
.top = 2600
.Width = 12160
End With
With Combo1
.AddItem ("工程编号") 'Form8.Combo1.AddItem (rs.Fields(i).Name)
.AddItem ("工程名称")
.AddItem ("结算日期")
End With
With Combo2
.AddItem ("Like")
End With
Form57.ListView1.ListItems.Clear
hzrs.CursorLocation = adUseClient
hzrs.Open "select * from 勘察工程任务结算单", hzconn, adOpenKeyset, adLockPessimistic
For o = 1 To hzrs.RecordCount
l = l + 1
Form57.ListView1.ListItems.Add , , hzrs.Fields(1).Value
Form57.ListView1.ListItems.Item(o).SubItems(1) = hzrs.Fields(2).Value
Form57.ListView1.ListItems.Item(o).SubItems(2) = hzrs.Fields(6).Value
Form57.ListView1.ListItems.Item(o).SubItems(3) = hzrs.Fields(75).Value
Form57.ListView1.ListItems.Item(o).SubItems(4) = hzrs.Fields(42).Value
Form57.ListView1.ListItems.Item(o).SubItems(5) = hzrs.Fields(50).Value
hzrs.MoveNext
Next
hzrs.Close
If l > 0 Then
Form57.ListView1.ListItems(Form57.ListView1.ListItems.Count).Selected = True
Form57.ListView1.SelectedItem.EnsureVisible
Form57.ListView1.Refresh
End If
End Sub
Private Sub ListView1_DblClick()
Dim i, m, j, n, p, l As Integer
Dim p1, p2, p3 As Single
m = 0
For i = 1 To Form57.ListView1.ListItems.Count
If Form57.ListView1.ListItems.Item(i).Checked = True Then
m = m + 1
End If
Next
If m <> 1 Then
MsgBox "修改一条记录!", vbInformation, "提示"
Exit Sub
End If
hzrs.CursorLocation = adUseClient
hzrs.Open "select * from 勘察工程任务结算单", hzconn, adOpenKeyset, adLockPessimistic
For i = 1 To Form57.ListView1.ListItems.Count
If Form57.ListView1.ListItems.Item(i).Checked = True Then
For j = 1 To hzrs.RecordCount
If hzrs.Fields(1).Value = Form57.ListView1.ListItems.Item(i) Then
For l = 1 To 6
kk(l) = hzrs.Fields(l).Value
If hzrs.Fields(l).Value = 0 Then
Form58.Text1(l).Text = ""
Else
Form58.Text1(l).Text = hzrs.Fields(l).Value
End If
Next
For l = 1 To 6
kk(l) = hzrs.Fields(l).Value
If hzrs.Fields(l).Value = 0 Then
Form58.Text1(l).Text = ""
Else
Form58.Text1(l).Text = hzrs.Fields(l).Value
End If
Next
For l = 26 To 50
kk(l) = hzrs.Fields(l).Value
If hzrs.Fields(l).Value = 0 Then
Form58.Text1(l).Text = ""
Else
Form58.Text1(l).Text = hzrs.Fields(l).Value
End If
Next
For l = 51 To 79
kk(l) = hzrs.Fields(l).Value
If hzrs.Fields(l).Value = 0 Then
Form58.Text1(l + 2).Text = ""
Else
Form58.Text1(l + 2).Text = hzrs.Fields(l).Value
End If
Next
End If
hzrs.MoveNext
Next
End If
Next
hzrs.Close
If ii(65) <> "0" Then
Form58.Text1(44).Text = username
' If kk(45) = "0" Then
Form58.Text1(45).Enabled = True
' End If
Form58.Command1.Visible = True
Form58.Command2.Visible = True
End If
If ii(66) <> "0" Then
Form58.Text1(46).Text = username
' If kk(47) = "0" Then
Form58.Text1(47).Enabled = True
' End If
Form58.Command1.Visible = True
Form58.Command2.Visible = True
End If
If ii(67) <> "0" Then
Form58.Text1(48).Text = username
If kk(49) = "0" Then
Form58.Text1(49).Enabled = True
End If
Form58.Command1.Visible = True
Form58.Command2.Visible = True
End If
Form58.Show vbModal
For p = 1 To Form57.ListView1.ListItems.Count
Form57.ListView1.ListItems.Item(p).Checked = False
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -