📄 ts4.frm
字号:
VERSION 5.00
Begin VB.Form ts4
BorderStyle = 1 'Fixed Single
Caption = "迁出户口"
ClientHeight = 1800
ClientLeft = 45
ClientTop = 330
ClientWidth = 3810
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1800
ScaleWidth = 3810
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2040
TabIndex = 2
Top = 1200
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 840
TabIndex = 1
Top = 1200
Width = 855
End
Begin VB.Label Label1
Caption = "迁出户口后会删除此户中所有人员信息,继续吗?"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 0
Top = 360
Width = 2655
End
End
Attribute VB_Name = "ts4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim qcriqi As String
Dim qwhedi As String
Dim xingming As String
Dim huhao As String
Dim y1 As String
y1 = "是"
qcriqi = frmqchu.Label13.Caption
qwhedi = Trim(frmqchu.Text4.Text)
xingming = frmqchu.Label16.Caption
huhao = frmqchu.Label3.Caption
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
Dim local_db As String
Set cnn = New ADODB.Connection
Set ret = New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
local_db = "delete from 人口表" + _
" where 人口表.户号=" + "'" + huhao + "'"
cnn.Execute local_db
Set ret = New ADODB.Recordset
local_db = "insert into 户迁出表 (" + "迁出日期," + "迁往何地," + "户号," + "户主姓名)" + _
" values (" + "'" + qcriqi + "'," + "'" + qwhedi + "'," + "'" + huhao + "'," + "'" + xingming + "')"
cnn.Execute local_db
Set ret = New ADODB.Recordset
local_db = "update 户口表" + _
" set 是否已迁出=" + "'" + y1 + "'" + _
" where 户口表.户号=" + "'" + huhao + "'"
cnn.Execute local_db
Unload ts4
Unload frmqchu
MsgBox "已经成功将此户迁出,仍可以查询到此户信息,但无法修改信息", , "提示"
mainfrm.Enabled = True
'初始化主窗口
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
End Sub
Private Sub Command2_Click()
Unload ts4
frmqcren.Enabled = True
mainfrm.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -