📄 form4.frm
字号:
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
Height = 315
Left = 240
TabIndex = 2
Text = "Combo1"
Top = 360
Width = 1575
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 285
Left = 2040
TabIndex = 1
Top = 360
Width = 1695
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "="
Height = 195
Left = 1920
TabIndex = 3
Top = 360
Width = 90
End
End
Begin VB.Label Label39
AutoSize = -1 'True
Caption = "号"
Height = 195
Left = 11040
TabIndex = 90
Top = 1200
Width = 180
End
Begin VB.Label Label38
AutoSize = -1 'True
Caption = "字"
Height = 195
Left = 9960
TabIndex = 88
Top = 1200
Width = 180
End
Begin VB.Label Label37
AutoSize = -1 'True
Caption = "北集用"
Height = 195
Left = 8400
TabIndex = 86
Top = 1200
Width = 540
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs2 As ADODB.Recordset
Public rsstringtemp1 As String
Dim aa As Boolean
Private Sub Command1_Click()
On Error Resume Next
Set cnn = New ADODB.Connection
Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient
rs2.CursorType = adOpenDynamic
rs2.LockType = adLockPessimistic
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\tdgl.mdb;Persist Security Info=False"
Dim combo As String
Select Case Combo1.Text
Case "土地使用者"
combo = "SoilUser"
Case "图号"
combo = "ChartNum"
Case "地号"
combo = "SoilNum"
Case "土地证号"
combo = "SoilCardNum"
End Select
If Text1.Text = "" Then
MsgBox "请输入查询条件"
Exit Sub
End If
Dim rsstring2 As String
rsstring2 = "select * from syqdjk where " & combo & "='" & Text1.Text & "'"
rsstringtemp1 = rsstring2
rs2.Open rsstring2, cnn
aa = True
If rs2.RecordCount = 0 Then
MsgBox "没有找到数据"
Else
Text3.Text = rs2!SoilUser
Text2.Text = rs2!SoilPos
Text4.Text = rs2!SoilownerZhen + "镇" + rs2!SoilownerCun + "村" + rs2!SoilownerZu + "组"
Text5.Text = rs2!ChartNum
Text6.Text = rs2!SoilNum
Text7.Text = rs2!SQSPB_Num
Text8.Text = rs2!SoilPurpose
Text9.Text = rs2!SYQMJ
Text10.Text = rs2!JZZDMJ
Text11.Text = rs2!PZYDLB
Text12.Text = rs2!YDQX
Text13.Text = rs2!DYMJ
Text14.Text = rs2!TDDJ
Text15.Text = rs2!PZYDJG
Text16.Text = rs2!FTMJ
Text17.Text = rs2!GYZDMJ
Text22.Text = rs2!TDSYQLY + rs2!TDSYQZMWJLX + rs2!TDSYQBH + rs2!TDSYQRQ
Text18.Text = rs2!PZDate
Text19.Text = rs2!JZLX
Text20.Text = rs2!JZWQS
Text21.Text = rs2!GYZSYQ
Text24.Text = rs2!BGXH2
Text23.Text = rs2!BGXH1
Text25.Text = rs2!BGXH3
Text26.Text = rs2!BGRQ1
Text27.Text = rs2!BGRQ2
Text28.Text = rs2!BGRQ3
Text29.Text = rs2!BGYJ1
Text30.Text = rs2!BGYJ2
Text31.Text = rs2!BGYJ3
Text32.Text = rs2!BGJBR1
Text33.Text = rs2!BGJBR2
Text34.Text = rs2!BGJBR3
Text35.Text = rs2!BGSHR1
Text36.Text = rs2!BGSHR2
Text37.Text = rs2!BGSHR3
Text38.Text = rs2!SZ1
Text39.Text = rs2!SZ2
Text40.Text = rs2!SZ3
Text41.Text = rs2!SZ4
Text43.Text = rs2!zi
Text44.Text = rs2!hao
End If
If rs2.RecordCount > 1 Then
Command5.Enabled = True
End If
Command4.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
End Sub
Private Sub Command2_Click()
On Error Resume Next
If rs2.RecordCount > 1 Then
rs2.MovePrevious
If Not rs2.BOF Then
Text3.Text = rs2!SoilUser
Text2.Text = rs2!SoilPos
Text4.Text = rs2!SoilownerZhen + "镇" + rs2!SoilownerCun + "村" + rs2!SoilownerZu + "组"
Text5.Text = rs2!ChartNum
Text6.Text = rs2!SoilNum
Text7.Text = rs2!SQSPB_Num
Text8.Text = rs2!SoilPurpose
Text9.Text = rs2!SYQMJ
Text10.Text = rs2!JZZDMJ
Text11.Text = rs2!PZYDLB
Text12.Text = rs2!YDQX
Text13.Text = rs2!DYMJ
Text14.Text = rs2!TDDJ
Text15.Text = rs2!PZYDJG
Text16.Text = rs2!FTMJ
Text17.Text = rs2!GYZDMJ
Text22.Text = rs2!TDSYQLY + rs2!TDSYQZMWJLX + rs2!TDSYQBH + rs2!TDSYQRQ
Text18.Text = rs2!PZDate
Text19.Text = rs2!JZLX
Text20.Text = rs2!JZWQS
Text21.Text = rs2!GYZSYQ
Text24.Text = rs2!BGXH2
Text23.Text = rs2!BGXH1
Text25.Text = rs2!BGXH3
Text26.Text = rs2!BGRQ1
Text27.Text = rs2!BGRQ2
Text28.Text = rs2!BGRQ3
Text29.Text = rs2!BGYJ1
Text30.Text = rs2!BGYJ2
Text31.Text = rs2!BGYJ3
Text32.Text = rs2!BGJBR1
Text33.Text = rs2!BGJBR2
Text34.Text = rs2!BGJBR3
Text35.Text = rs2!BGSHR1
Text36.Text = rs2!BGSHR2
Text37.Text = rs2!BGSHR3
Text38.Text = rs2!SZ1
Text39.Text = rs2!SZ2
Text40.Text = rs2!SZ3
Text41.Text = rs2!SZ4
Text43.Text = rs2!zi
Text44.Text = rs2!hao
Else
MsgBox "已经是第一条记录"
Command2.Enabled = False
End If
Command5.Enabled = True
End If
End Sub
Private Sub Command3_Click()
On Error Resume Next
On Error Resume Next
Text3.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text22.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text24.Text = ""
Text23.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
Text31.Text = ""
Text32.Text = ""
Text33.Text = ""
Text34.Text = ""
Text35.Text = ""
Text36.Text = ""
Text37.Text = ""
Text38.Text = ""
Text39.Text = ""
Text40.Text = ""
Text41.Text = ""
Text43.Text = ""
Text44.Text = ""
If aa = True Then
rs2.Close
cnn.Close
End If
Form4.Hide
Form1.Show
End Sub
Private Sub Command4_Click()
On Error Resume Next
DataReport2.Show
End Sub
Private Sub Command5_Click()
On Error Resume Next
If rs2.RecordCount > 1 Then
rs2.MoveNext
If Not rs2.EOF Then
Text3.Text = rs2!SoilUser
Text2.Text = rs2!SoilPos
Text4.Text = rs2!SoilownerZhen + "镇" + rs2!SoilownerCun + "村" + rs2!SoilownerZu + "组"
Text5.Text = rs2!ChartNum
Text6.Text = rs2!SoilNum
Text7.Text = rs2!SQSPB_Num
Text8.Text = rs2!SoilPurpose
Text9.Text = rs2!SYQMJ
Text10.Text = rs2!JZZDMJ
Text11.Text = rs2!PZYDLB
Text12.Text = rs2!YDQX
Text13.Text = rs2!DYMJ
Text14.Text = rs2!TDDJ
Text15.Text = rs2!PZYDJG
Text16.Text = rs2!FTMJ
Text17.Text = rs2!GYZDMJ
Text22.Text = rs2!TDSYQLY + rs2!TDSYQZMWJLX + rs2!TDSYQBH + rs2!TDSYQRQ
Text18.Text = rs2!PZDate
Text19.Text = rs2!JZLX
Text20.Text = rs2!JZWQS
Text21.Text = rs2!GYZSYQ
Text24.Text = rs2!BGXH2
Text23.Text = rs2!BGXH1
Text25.Text = rs2!BGXH3
Text26.Text = rs2!BGRQ1
Text27.Text = rs2!BGRQ2
Text28.Text = rs2!BGRQ3
Text29.Text = rs2!BGYJ1
Text30.Text = rs2!BGYJ2
Text31.Text = rs2!BGYJ3
Text32.Text = rs2!BGJBR1
Text33.Text = rs2!BGJBR2
Text34.Text = rs2!BGJBR3
Text35.Text = rs2!BGSHR1
Text36.Text = rs2!BGSHR2
Text37.Text = rs2!BGSHR3
Text38.Text = rs2!SZ1
Text39.Text = rs2!SZ2
Text40.Text = rs2!SZ3
Text41.Text = rs2!SZ4
Text43.Text = rs2!zi
Text44.Text = rs2!hao
Else
MsgBox "已经是最后一条记录"
Command5.Enabled = False
End If
Command2.Enabled = True
End If
End Sub
Private Sub Command6_Click()
On Error Resume Next
rs2!SoilUser = Text3.Text
rs2!SoilPos = Text2.Text
' Text4.Text = rs2!SoilownerZhen + "镇" + rs2!SoilownerCun + "村" + rs2!SoilownerZu + "组"
rs2!SoilownerZhen = rs2!SoilownerZhen
rs2!SoilownerCun = rs2!SoilownerCun
rs2!SoilownerZu = rs2!SoilownerZu
rs2!ChartNum = Text5.Text
rs2!SoilNum = Text6.Text
rs2!SQSPB_Num = Text7.Text
rs2!SoilPurpose = Text8.Text
rs2!SYQMJ = Text9.Text
rs2!JZZDMJ = Text10.Text
rs2!PZYDLB = Text11.Text
rs2!YDQX = Text12.Text
rs2!DYMJ = Text13.Text
rs2!TDDJ = Text14.Text
rs2!PZYDJG = Text15.Text
rs2!FTMJ = Text16.Text
rs2!GYZDMJ = Text17.Text
'Text22.Text = rs2!TDSYQLY + rs2!TDSYQZMWJLX + rs2!TDSYQBH + Str(rs2!TDSYQRQ)
rs2!TDSYQLY = rs2!TDSYQLY
rs2!TDSYQZMWJLX = rs2!TDSYQZMWJLX
rs2!TDSYQBH = rs2!TDSYQBH
rs2!TDSYQRQ = rs2!TDSYQRQ
rs2!PZDate = Text18.Text
rs2!JZLX = Text19.Text
rs2!JZWQS = Text20.Text
rs2!GYZSYQ = Text21.Text
rs2!BGXH2 = Text24.Text
rs2!BGXH1 = Text23.Text
rs2!BGXH3 = Text25.Text
rs2!BGRQ1 = Text26.Text
rs2!BGRQ2 = Text27.Text
rs2!BGRQ3 = Text28.Text
rs2!BGYJ1 = Text29.Text
rs2!BGYJ2 = Text30.Text
rs2!BGYJ3 = Text31.Text
rs2!BGJBR1 = Text32.Text
rs2!BGJBR2 = Text33.Text
rs2!BGJBR3 = Text34.Text
rs2!BGSHR1 = Text35.Text
rs2!BGSHR2 = Text36.Text
rs2!BGSHR3 = Text37.Text
rs2!SZ1 = Text38.Text
rs2!SZ2 = Text39.Text
rs2!SZ3 = Text40.Text
rs2!SZ4 = Text41.Text
rs2!zi = Text43.Text
rs2!hao = Text44.Text
rs2.Update
End Sub
Private Sub Command7_Click()
'Printer.PaperSize = vbPRPSA4 '定义纸张大小为A4
'Printer.Orientation = vbPRORPortrait '纵向打印
'Printer.Orientation = vbPRORLandscape '横向打印
DataReport5.PrintReport True, 1, 1, 1
'DataReport5.Show
End Sub
Private Sub Form_Load()
On Error Resume Next
Combo1.AddItem "土地使用者"
Combo1.AddItem "图号"
Combo1.AddItem "地号"
Combo1.AddItem "土地证号"
Combo1.Text = Combo1.List(0)
aa = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Text3.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text22.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text24.Text = ""
Text23.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
Text31.Text = ""
Text32.Text = ""
Text33.Text = ""
Text34.Text = ""
Text35.Text = ""
Text36.Text = ""
Text37.Text = ""
Text38.Text = ""
Text39.Text = ""
Text40.Text = ""
Text41.Text = ""
Text43.Text = ""
Text44.Text = ""
If aa = True Then
rs2.Close
cnn.Close
End If
Form4.Hide
Form1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -