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

📄 frmcensus.frm

📁 Family Tree This a geneology program for entering your family tree. It s a complete working app but
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmCensus 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Census"
   ClientHeight    =   6960
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   13230
   HelpContextID   =   8
   Icon            =   "frmCensus.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6960
   ScaleWidth      =   13230
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdHelp 
      Caption         =   "&Help"
      Height          =   345
      Left            =   8370
      TabIndex        =   26
      Top             =   6510
      Width           =   885
   End
   Begin VB.TextBox txtRef 
      Height          =   285
      Left            =   11370
      TabIndex        =   10
      Top             =   1140
      Width           =   1815
   End
   Begin VB.CommandButton cmdFind 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   3600
      Picture         =   "frmCensus.frx":058A
      Style           =   1  'Graphical
      TabIndex        =   24
      ToolTipText     =   "Find an Existing PLU"
      Top             =   6510
      Width           =   330
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "&Add"
      Height          =   345
      Left            =   10230
      TabIndex        =   12
      Top             =   6510
      Width           =   885
   End
   Begin VB.TextBox txtEdit 
      BackColor       =   &H00C0FFFF&
      BorderStyle     =   0  'None
      Height          =   285
      Left            =   330
      TabIndex        =   0
      TabStop         =   0   'False
      Top             =   6480
      Visible         =   0   'False
      Width           =   2685
   End
   Begin VB.TextBox txtAddress 
      Height          =   285
      Left            =   1920
      TabIndex        =   9
      Top             =   1110
      Width           =   3045
   End
   Begin VB.TextBox txtTown 
      Height          =   285
      Left            =   11370
      TabIndex        =   8
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtParlDiv 
      Height          =   285
      Left            =   9480
      TabIndex        =   7
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtDistrict 
      Height          =   285
      Left            =   7590
      TabIndex        =   6
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtWard 
      Height          =   285
      Left            =   5700
      TabIndex        =   5
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtCountyBorough 
      Height          =   285
      Left            =   3810
      TabIndex        =   4
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtEccParish 
      Height          =   285
      Left            =   1920
      TabIndex        =   3
      Top             =   750
      Width           =   1815
   End
   Begin VB.TextBox txtCounty 
      Height          =   285
      Left            =   1110
      TabIndex        =   1
      Top             =   60
      Width           =   2025
   End
   Begin VB.TextBox txtCivParish 
      Height          =   285
      Left            =   30
      TabIndex        =   2
      Top             =   750
      Width           =   1815
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "&Save"
      Enabled         =   0   'False
      Height          =   345
      Left            =   11340
      TabIndex        =   11
      Top             =   6510
      Width           =   885
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Default         =   -1  'True
      Height          =   345
      Left            =   12300
      TabIndex        =   14
      Top             =   6510
      Width           =   885
   End
   Begin MSFlexGridLib.MSFlexGrid grdMain 
      Height          =   4965
      Left            =   330
      TabIndex        =   13
      Top             =   1440
      Width           =   12885
      _ExtentX        =   22728
      _ExtentY        =   8758
      _Version        =   393216
      Rows            =   20
      ForeColorFixed  =   -2147483641
      BackColorSel    =   8454143
      ForeColorSel    =   -2147483630
      AllowUserResizing=   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label10 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "Ref:"
      Height          =   195
      Left            =   11010
      TabIndex        =   25
      Top             =   1170
      Width           =   300
   End
   Begin VB.Label Label9 
      Alignment       =   1  'Right Justify
      Caption         =   "Address:"
      Height          =   225
      Left            =   930
      TabIndex        =   23
      Top             =   1140
      Width           =   945
   End
   Begin VB.Label Label8 
      Caption         =   "Parliamentary Division:"
      Height          =   255
      Left            =   11400
      TabIndex        =   22
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label7 
      Caption         =   "Parliamentary Division:"
      Height          =   255
      Left            =   9510
      TabIndex        =   21
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label6 
      Caption         =   "Rural District:"
      Height          =   255
      Left            =   7620
      TabIndex        =   20
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label5 
      Caption         =   "Ward of Borough:"
      Height          =   255
      Left            =   5730
      TabIndex        =   19
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label4 
      Caption         =   "County Borough:"
      Height          =   255
      Left            =   3840
      TabIndex        =   18
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label3 
      Caption         =   "Ecclesiastical Parish:"
      Height          =   255
      Left            =   1950
      TabIndex        =   17
      Top             =   450
      Width           =   1785
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "County:"
      Height          =   255
      Left            =   90
      TabIndex        =   16
      Top             =   90
      Width           =   945
   End
   Begin VB.Label Label1 
      Caption         =   "Civil Parish:"
      Height          =   255
      Left            =   60
      TabIndex        =   15
      Top             =   450
      Width           =   1785
   End
End
Attribute VB_Name = "frmCensus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Enum grdCols
    col_Id      'The indid of the person
    col_idName  'The name as on the individuals file
    col_Name    'The name as recorded on the census return
    col_rel
    col_Marr
    col_AgeM
    col_AgeF
    col_Occ
    col_Emp
    col_WHome
    col_Born
    col_State
End Enum

Private mlcnhID As Long
Private mbChanged As Boolean 'Indicates data has changed
Private miYear As Long       'The year of the census
Private lRow As Long
Private lCol As Long

Public Function invoke(IndID As Long, iYear As Integer) As Boolean

    miYear = iYear
    Me.Caption = iYear & " Census for "

    Call SetupGrid
    
    Call GetCensusInfo(IndID, iYear)

    
    Me.Show vbModal
End Function

Private Sub SetupGrid()
    lRow = 0
    lCol = 0

    With grdMain
        .Clear
        .Cols = 12
        .FixedCols = 0
        .Rows = 2
        .FixedRows = 1
        
        .ColAlignment(col_Id) = flexAlignLeftCenter
        .ColAlignment(col_idName) = flexAlignLeftCenter
        .ColAlignment(col_Name) = flexAlignLeftCenter
        .ColAlignment(col_rel) = flexAlignLeftCenter
        .ColAlignment(col_Marr) = flexAlignCenterCenter
        .ColAlignment(col_AgeM) = flexAlignCenterCenter
        .ColAlignment(col_AgeF) = flexAlignCenterCenter
        .ColAlignment(col_Occ) = flexAlignLeftCenter
        .ColAlignment(col_Emp) = flexAlignLeftCenter
        .ColAlignment(col_WHome) = flexAlignLeftCenter
        .ColAlignment(col_Born) = flexAlignLeftCenter
        .ColAlignment(col_State) = flexAlignLeftCenter
        
        .ColWidth(col_Id) = 0
        .ColWidth(col_idName) = .Width * (15 / 100)
        .ColWidth(col_Name) = .Width * (15 / 100)
        .ColWidth(col_rel) = .Width * (7 / 100)
        .ColWidth(col_Marr) = .Width * (3 / 100)
        .ColWidth(col_AgeM) = .Width * (4 / 100)
        .ColWidth(col_AgeF) = .Width * (4 / 100)
        .ColWidth(col_Occ) = .Width * (14 / 100)
        .ColWidth(col_Emp) = .Width * (9 / 100)
        .ColWidth(col_WHome) = .Width * (9 / 100)
        .ColWidth(col_Born) = .Width * (12 / 100)
        .ColWidth(col_State) = .Width * (7 / 100)
        
        .TextMatrix(0, col_idName) = "Link Name to Individual"
        .TextMatrix(0, col_Name) = "Name and Surname"
        .TextMatrix(0, col_rel) = "Relation"
        .TextMatrix(0, col_Marr) = "M/S"
        .TextMatrix(0, col_AgeM) = "M"
        .TextMatrix(0, col_AgeF) = "F"
        .TextMatrix(0, col_Occ) = "Occupation"
        .TextMatrix(0, col_Emp) = "Employer"
        .TextMatrix(0, col_WHome) = "Wkg at Home"
        .TextMatrix(0, col_Born) = "Where Born"
        .TextMatrix(0, col_State) = "State"

    End With
End Sub

Private Sub cmdAdd_Click()
    grdMain.Rows = grdMain.Rows + 1
    grdMain.Col = col_Name
    grdMain.Row = grdMain.Rows - 1
    mbChanged = True
    SwitchControls (ONN)
End Sub

Private Function GetCensusInfo(lngId As Long, iYear As Integer)
Dim SQL As String
Dim RS As ADODB.Recordset
Dim lRow As Long
Dim sErr As String

    On Error GoTo ErrSub
    
    SQL = "Select " & gccCENCNHID & " FROM " & gtcCENSUS & " LEFT JOIN " & gtcCENSUSHEADER & " ON " & _
            gtcCENSUS & "." & gccCENCNHID & " = " & gtcCENSUSHEADER & "." & gccCNHID & " WHERE " & _
            gccCNHYEAR & " = " & iYear & " AND " & _

⌨️ 快捷键说明

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