⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmprint.frm

📁 我VB遍的工资管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmprint 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "打印户口卡"
   ClientHeight    =   6120
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4590
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6120
   ScaleWidth      =   4590
   Begin VB.CommandButton Command3 
      Caption         =   "关闭"
      Height          =   375
      Left            =   1680
      TabIndex        =   10
      Top             =   5520
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Caption         =   "打印人口信息"
      Height          =   1575
      Left            =   120
      TabIndex        =   1
      Top             =   3720
      Width           =   4335
      Begin VB.CommandButton Command2 
         Caption         =   "确定"
         Height          =   375
         Left            =   3240
         TabIndex        =   9
         Top             =   960
         Width           =   855
      End
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   720
         MaxLength       =   22
         TabIndex        =   7
         Top             =   960
         Width           =   2295
      End
      Begin VB.Label Label2 
         Caption         =   "请输入身份证号:"
         Height          =   375
         Left            =   360
         TabIndex        =   3
         Top             =   480
         Width           =   1575
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "打印户口信息"
      Height          =   1695
      Left            =   120
      TabIndex        =   0
      Top             =   1440
      Width           =   4335
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   3240
         TabIndex        =   8
         Top             =   960
         Width           =   855
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   1680
         MaxLength       =   10
         TabIndex        =   6
         Top             =   960
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   720
         MaxLength       =   3
         TabIndex        =   4
         Top             =   960
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "-"
         Height          =   255
         Left            =   1320
         TabIndex        =   5
         Top             =   960
         Width           =   135
      End
      Begin VB.Label Label1 
         Caption         =   "请输入户号:"
         Height          =   375
         Left            =   360
         TabIndex        =   2
         Top             =   480
         Width           =   1215
      End
   End
   Begin VB.Label Label6 
      Caption         =   "·输入正确身份证号才能进入打印人口信息页面"
      ForeColor       =   &H00000080&
      Height          =   255
      Left            =   240
      TabIndex        =   13
      Top             =   3360
      Width           =   3855
   End
   Begin VB.Label Label5 
      Caption         =   "·输入正确户号才能进入打印户口信息页面"
      ForeColor       =   &H00000080&
      Height          =   255
      Left            =   240
      TabIndex        =   12
      Top             =   1080
      Width           =   3495
   End
   Begin VB.Image Image1 
      Height          =   495
      Left            =   3720
      Picture         =   "frmprint.frx":0000
      Top             =   240
      Width           =   510
   End
   Begin VB.Shape Shape1 
      Height          =   615
      Left            =   120
      Top             =   240
      Width           =   3015
   End
   Begin VB.Label Label4 
      Caption         =   "打印户口卡验证"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   360
      TabIndex        =   11
      Top             =   360
      Width           =   2655
   End
End
Attribute VB_Name = "frmprint"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim thuhao As String
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
Dim local_db As String
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
thuhao = Trim(Text1.Text) & Label3.Caption & Trim(Text2.Text)
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "户号未输入或格式不正确", , "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
Set ret = New ADODB.Recordset
local_db = "select * from 户口表" + _
" where 户口表.户号=" + "'" + thuhao + "'"
ret.Open local_db, cnn
If ret.BOF And ret.EOF Then
MsgBox "无此户号,请重新输入"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
frmphu.Label3.Caption = ret("户号")
frmphu.Label7.Caption = ret("登记日期")
frmphu.Label11.Caption = ret("户别")
frmphu.Label16.Caption = ret("户主姓名")
frmphu.Label17.Caption = ret("住址")
frmphu.Label9.Caption = ret("迁入日期")
frmphu.Label18.Caption = ret("何地迁入")
ret.Close
Set ret = New ADODB.Recordset
local_db = "select * from 户迁出表" + _
" where 户迁出表.户号=" + "'" + thuhao + "'"
ret.Open local_db, cnn
If Not (ret.BOF And ret.EOF) Then
frmphu.Label13.Caption = ret("迁出日期")
frmphu.Label19.Caption = ret("迁往何地")
End If
Unload frmprint
frmphu.Show
frmpt.Show
frmphu.Enabled = False
mainfrm.Enabled = False
mainfrm.Command5.Enabled = False
End If
End If
End Sub

Private Sub Command2_Click()
Dim tidcard As String
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
Dim local_db As String
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
tidcard = Trim(Text3.Text)
If Text3.Text = "" Then
MsgBox "请输入身份证号", , "警告"
Text3.SetFocus
Else
Set ret = New ADODB.Recordset
local_db = "select * from 人口表" + _
" where 人口表.身份证号=" + "'" + tidcard + "'"
ret.Open local_db, cnn
If ret.BOF And ret.EOF Then
MsgBox "无此身份证号,请重新输入"
Text3.Text = ""
Text3.SetFocus
Else
Dim d1 As String
frmpren.Label2.Caption = ret("户号")
frmpren.Label38.Caption = ret("姓名")
frmpren.Label3.Caption = ret("与户主关系")
frmpren.Label39.Caption = ret("身份证号")
frmpren.Label4.Caption = ret("性别")
frmpren.Label8.Caption = ret("民族")
frmpren.Label29.Caption = ret("籍贯")
d1 = ret("出生日期")
frmpren.Label30.Caption = Mid(d1, 1, 4)
frmpren.Label31.Caption = Mid(d1, 5, 2)
frmpren.Label36.Caption = Mid(d1, 7, 2)
frmpren.Label34.Caption = ret("出生地")
frmpren.Label41.Caption = ret("文化程度")
frmpren.Label6.Caption = ret("婚姻状况")
frmpren.Label40.Caption = ret("职业")
frmpren.Label43.Caption = ret("工作单位")
frmpren.Label23.Caption = ret("迁入日期")
frmpren.Label28.Caption = ret("何地迁入")
ret.Close
Set ret = New ADODB.Recordset
local_db = "select * from 人迁出表" + _
" where 人迁出表.身份证号=" + "'" + tidcard + "'"
ret.Open local_db, cnn
If Not (ret.BOF And ret.EOF) Then
frmpren.Label26.Caption = ret("迁出日期")
frmpren.Label33.Caption = ret("迁往何地")
End If
Unload frmprint
frmpren.Show
frmpt2.Show
frmpren.Enabled = False
mainfrm.Enabled = False
mainfrm.Command5.Enabled = False
End If
End If
End Sub

Private Sub Command3_Click()
Unload frmprint
'初始化主窗口
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
GetStatus "<就绪>"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -