www.pudn.com > vb625557712344.rar > FrmCarEdit.frm, change:2005-06-03,size:27016b


VERSION 5.00 
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX" 
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX" 
Begin VB.Form FrmCarEdit  
   Caption         =   "编辑车辆信息" 
   ClientHeight    =   6645 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   9570 
   LinkTopic       =   "Form1" 
   Picture         =   "FrmCarEdit.frx":0000 
   ScaleHeight     =   6645 
   ScaleWidth      =   9570 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton Cmd_Exit  
      Caption         =   "取 消" 
      Height          =   375 
      Left            =   5040 
      MouseIcon       =   "FrmCarEdit.frx":E2C4 
      MousePointer    =   99  'Custom 
      TabIndex        =   55 
      Top             =   6000 
      Width           =   1215 
   End 
   Begin VB.CommandButton Cmd_OK  
      Caption         =   "确 定" 
      Height          =   375 
      Left            =   2160 
      MouseIcon       =   "FrmCarEdit.frx":E5CE 
      MousePointer    =   99  'Custom 
      TabIndex        =   54 
      Top             =   6000 
      Width           =   1215 
   End 
   Begin VB.Frame Frame4  
      Caption         =   "车辆描述" 
      Height          =   1215 
      Left            =   120 
      TabIndex        =   52 
      Top             =   4560 
      Width           =   9375 
      Begin VB.TextBox txtComment  
         Height          =   855 
         Left            =   120 
         MultiLine       =   -1  'True 
         TabIndex        =   53 
         Top             =   240 
         Width           =   9015 
      End 
   End 
   Begin VB.Frame Frame3  
      Caption         =   "租赁价格" 
      Height          =   1455 
      Left            =   120 
      TabIndex        =   31 
      Top             =   3000 
      Width           =   9375 
      Begin VB.TextBox txtWeekEndPrice  
         Height          =   300 
         Left            =   960 
         TabIndex        =   59 
         Top             =   720 
         Width           =   1095 
      End 
      Begin VB.TextBox txtOKMPrice  
         Height          =   300 
         Left            =   7080 
         TabIndex        =   50 
         Top             =   1080 
         Width           =   1095 
      End 
      Begin VB.TextBox txtOTPrice  
         Height          =   300 
         Left            =   3960 
         TabIndex        =   47 
         Top             =   1080 
         Width           =   1095 
      End 
      Begin VB.TextBox txtDayKM  
         Height          =   300 
         Left            =   960 
         TabIndex        =   44 
         Top             =   1080 
         Width           =   1095 
      End 
      Begin VB.TextBox txtMonthPrice  
         Height          =   300 
         Left            =   7080 
         TabIndex        =   39 
         Top             =   720 
         Width           =   1095 
      End 
      Begin VB.TextBox txtWeekPrice  
         Height          =   300 
         Left            =   3960 
         TabIndex        =   37 
         Top             =   720 
         Width           =   1095 
      End 
      Begin VB.TextBox txtDayPrice  
         Height          =   300 
         Left            =   3960 
         TabIndex        =   35 
         Top             =   300 
         Width           =   1095 
      End 
      Begin VB.TextBox txtDeposit  
         Height          =   300 
         Left            =   960 
         TabIndex        =   33 
         Top             =   300 
         Width           =   1095 
      End 
      Begin VB.Label Label31  
         AutoSize        =   -1  'True 
         Caption         =   "周末租金" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   61 
         Top             =   720 
         Width           =   720 
      End 
      Begin VB.Label Label30  
         AutoSize        =   -1  'True 
         Caption         =   "元/两日" 
         Height          =   180 
         Left            =   2160 
         TabIndex        =   60 
         Top             =   720 
         Width           =   630 
      End 
      Begin VB.Label Label29  
         AutoSize        =   -1  'True 
         Caption         =   "元" 
         Height          =   180 
         Left            =   2160 
         TabIndex        =   58 
         Top             =   360 
         Width           =   180 
      End 
      Begin VB.Label Label27  
         AutoSize        =   -1  'True 
         Caption         =   "元/公里" 
         Height          =   180 
         Left            =   8280 
         TabIndex        =   51 
         Top             =   1080 
         Width           =   630 
      End 
      Begin VB.Label Label26  
         AutoSize        =   -1  'True 
         Caption         =   "超公里加" 
         Height          =   180 
         Left            =   6240 
         TabIndex        =   49 
         Top             =   1080 
         Width           =   720 
      End 
      Begin VB.Label Label25  
         AutoSize        =   -1  'True 
         Caption         =   "元/时" 
         Height          =   180 
         Left            =   5160 
         TabIndex        =   48 
         Top             =   1080 
         Width           =   450 
      End 
      Begin VB.Label Label24  
         AutoSize        =   -1  'True 
         Caption         =   "超时加" 
         Height          =   180 
         Left            =   3240 
         TabIndex        =   46 
         Top             =   1080 
         Width           =   540 
      End 
      Begin VB.Label Label23  
         AutoSize        =   -1  'True 
         Caption         =   "公里/日" 
         Height          =   180 
         Left            =   2160 
         TabIndex        =   45 
         Top             =   1080 
         Width           =   630 
      End 
      Begin VB.Label Label22  
         AutoSize        =   -1  'True 
         Caption         =   "日限公里" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   43 
         Top             =   1080 
         Width           =   720 
      End 
      Begin VB.Label Label21  
         AutoSize        =   -1  'True 
         Caption         =   "元/月" 
         Height          =   180 
         Left            =   8280 
         TabIndex        =   42 
         Top             =   720 
         Width           =   450 
      End 
      Begin VB.Label Label20  
         AutoSize        =   -1  'True 
         Caption         =   "元/周" 
         Height          =   180 
         Left            =   5160 
         TabIndex        =   41 
         Top             =   720 
         Width           =   450 
      End 
      Begin VB.Label Label19  
         AutoSize        =   -1  'True 
         Caption         =   "元/日" 
         Height          =   180 
         Left            =   5160 
         TabIndex        =   40 
         Top             =   360 
         Width           =   450 
      End 
      Begin VB.Label Label18  
         AutoSize        =   -1  'True 
         Caption         =   "月租金" 
         Height          =   180 
         Left            =   6240 
         TabIndex        =   38 
         Top             =   720 
         Width           =   540 
      End 
      Begin VB.Label Label17  
         AutoSize        =   -1  'True 
         Caption         =   "周租金" 
         Height          =   180 
         Left            =   3240 
         TabIndex        =   36 
         Top             =   720 
         Width           =   540 
      End 
      Begin VB.Label Label16  
         AutoSize        =   -1  'True 
         Caption         =   "日租金" 
         Height          =   180 
         Left            =   3240 
         TabIndex        =   34 
         Top             =   360 
         Width           =   540 
      End 
      Begin VB.Label Label15  
         AutoSize        =   -1  'True 
         Caption         =   "押  金" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   32 
         Top             =   360 
         Width           =   540 
      End 
   End 
   Begin VB.Frame Frame2  
      Caption         =   "保险信息" 
      Height          =   1095 
      Left            =   120 
      TabIndex        =   19 
      Top             =   1800 
      Width           =   9375 
      Begin VB.TextBox txtEDate  
         BeginProperty DataFormat  
            Type            =   1 
            Format          =   "yyyy-MM-dd" 
            HaveTrueFalseNull=   0 
            FirstDayOfWeek  =   0 
            FirstWeekOfYear =   0 
            LCID            =   2052 
            SubFormatType   =   3 
         EndProperty 
         Height          =   300 
         Left            =   7920 
         TabIndex        =   30 
         Top             =   350 
         Width           =   1215 
      End 
      Begin VB.TextBox txtSDate  
         BeginProperty DataFormat  
            Type            =   1 
            Format          =   "yyyy-MM-dd" 
            HaveTrueFalseNull=   0 
            FirstDayOfWeek  =   0 
            FirstWeekOfYear =   0 
            LCID            =   2052 
            SubFormatType   =   3 
         EndProperty 
         Height          =   300 
         Left            =   5640 
         TabIndex        =   29 
         Top             =   350 
         Width           =   1215 
      End 
      Begin VB.CommandButton Cmd_Select  
         Caption         =   "选择" 
         Height          =   300 
         Left            =   4680 
         TabIndex        =   28 
         Top             =   720 
         Width           =   615 
      End 
      Begin VB.TextBox txtInsurType  
         Enabled         =   0   'False 
         Height          =   270 
         Left            =   960 
         TabIndex        =   27 
         Top             =   720 
         Width           =   3615 
      End 
      Begin MSDataListLib.DataCombo dco_Insu  
         Height          =   330 
         Left            =   960 
         TabIndex        =   26 
         Top             =   350 
         Width           =   1215 
         _ExtentX        =   2143 
         _ExtentY        =   582 
         _Version        =   393216 
         Style           =   2 
         ListField       =   "" 
         BoundColumn     =   "" 
         Text            =   "" 
      End 
      Begin VB.TextBox txtInsurNo  
         Height          =   270 
         Left            =   3000 
         TabIndex        =   25 
         Top             =   350 
         Width           =   1575 
      End 
      Begin MSAdodcLib.Adodc AdodcInsurance  
         Height          =   375 
         Left            =   6480 
         Top             =   720 
         Visible         =   0   'False 
         Width           =   2655 
         _ExtentX        =   4683 
         _ExtentY        =   661 
         ConnectMode     =   0 
         CursorLocation  =   3 
         IsolationLevel  =   -1 
         ConnectionTimeout=   15 
         CommandTimeout  =   30 
         CursorType      =   3 
         LockType        =   3 
         CommandType     =   8 
         CursorOptions   =   0 
         CacheSize       =   50 
         MaxRecords      =   0 
         BOFAction       =   0 
         EOFAction       =   0 
         ConnectStringType=   1 
         Appearance      =   1 
         BackColor       =   -2147483643 
         ForeColor       =   -2147483640 
         Orientation     =   0 
         Enabled         =   -1 
         Connect         =   "" 
         OLEDBString     =   "" 
         OLEDBFile       =   "" 
         DataSourceName  =   "" 
         OtherAttributes =   "" 
         UserName        =   "" 
         Password        =   "" 
         RecordSource    =   "" 
         Caption         =   "AdodcInsurance" 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         _Version        =   393216 
      End 
      Begin VB.Label Label14  
         AutoSize        =   -1  'True 
         Caption         =   "结束日期" 
         Height          =   180 
         Left            =   7080 
         TabIndex        =   24 
         Top             =   350 
         Width           =   720 
      End 
      Begin VB.Label Label13  
         AutoSize        =   -1  'True 
         Caption         =   "开始日期" 
         Height          =   180 
         Left            =   4800 
         TabIndex        =   23 
         Top             =   350 
         Width           =   720 
      End 
      Begin VB.Label Label12  
         AutoSize        =   -1  'True 
         Caption         =   "保单号" 
         Height          =   180 
         Left            =   2400 
         TabIndex        =   22 
         Top             =   350 
         Width           =   540 
      End 
      Begin VB.Label Label11  
         AutoSize        =   -1  'True 
         Caption         =   "保险种类" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   21 
         Top             =   720 
         Width           =   720 
      End 
      Begin VB.Label Label10  
         AutoSize        =   -1  'True 
         Caption         =   "保险公司" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   20 
         Top             =   350 
         Width           =   720 
      End 
   End 
   Begin VB.Frame Frame1  
      Caption         =   "基本信息" 
      Height          =   1575 
      Left            =   120 
      TabIndex        =   0 
      Top             =   120 
      Width           =   9375 
      Begin VB.ComboBox cob_Status  
         Height          =   300 
         Left            =   3240 
         TabIndex        =   57 
         Text            =   "待命" 
         Top             =   1140 
         Width           =   1215 
      End 
      Begin VB.TextBox txtBuyDate  
         BeginProperty DataFormat  
            Type            =   1 
            Format          =   "yyyy-MM-dd" 
            HaveTrueFalseNull=   0 
            FirstDayOfWeek  =   0 
            FirstWeekOfYear =   0 
            LCID            =   2052 
            SubFormatType   =   3 
         EndProperty 
         Height          =   300 
         Left            =   7920 
         TabIndex        =   18 
         Top             =   700 
         Width           =   1215 
      End 
      Begin MSAdodcLib.Adodc AdodcSales  
         Height          =   330 
         Left            =   4560 
         Top             =   1080 
         Visible         =   0   'False 
         Width           =   2175 
         _ExtentX        =   3836 
         _ExtentY        =   582 
         ConnectMode     =   0 
         CursorLocation  =   3 
         IsolationLevel  =   -1 
         ConnectionTimeout=   15 
         CommandTimeout  =   30 
         CursorType      =   3 
         LockType        =   3 
         CommandType     =   8 
         CursorOptions   =   0 
         CacheSize       =   50 
         MaxRecords      =   0 
         BOFAction       =   0 
         EOFAction       =   0 
         ConnectStringType=   1 
         Appearance      =   1 
         BackColor       =   -2147483643 
         ForeColor       =   -2147483640 
         Orientation     =   0 
         Enabled         =   -1 
         Connect         =   "" 
         OLEDBString     =   "" 
         OLEDBFile       =   "" 
         DataSourceName  =   "" 
         OtherAttributes =   "" 
         UserName        =   "" 
         Password        =   "" 
         RecordSource    =   "" 
         Caption         =   "AdodcSales" 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         _Version        =   393216 
      End 
      Begin MSDataListLib.DataCombo dco_Sale  
         Height          =   330 
         Left            =   960 
         TabIndex        =   17 
         Top             =   1125 
         Width           =   1335 
         _ExtentX        =   2355 
         _ExtentY        =   582 
         _Version        =   393216 
         Style           =   2 
         ListField       =   "" 
         BoundColumn     =   "" 
         Text            =   "" 
      End 
      Begin VB.TextBox txtCarCase  
         Height          =   300 
         Left            =   3240 
         TabIndex        =   14 
         Top             =   750 
         Width           =   1215 
      End 
      Begin VB.TextBox txtEngineNo  
         Height          =   300 
         Left            =   960 
         TabIndex        =   12 
         Top             =   750 
         Width           =   1335 
      End 
      Begin VB.TextBox txtOilNo  
         Height          =   300 
         Left            =   5640 
         TabIndex        =   10 
         Top             =   750 
         Width           =   1095 
      End 
      Begin VB.ComboBox cbo_Color  
         Height          =   300 
         ItemData        =   "FrmCarEdit.frx":E8D8 
         Left            =   7920 
         List            =   "FrmCarEdit.frx":E8E5 
         TabIndex        =   8 
         Top             =   360 
         Width           =   1215 
      End 
      Begin MSAdodcLib.Adodc AdodcType  
         Height          =   330 
         Left            =   6840 
         Top             =   1080 
         Visible         =   0   'False 
         Width           =   2295 
         _ExtentX        =   4048 
         _ExtentY        =   582 
         ConnectMode     =   0 
         CursorLocation  =   3 
         IsolationLevel  =   -1 
         ConnectionTimeout=   15 
         CommandTimeout  =   30 
         CursorType      =   3 
         LockType        =   3 
         CommandType     =   8 
         CursorOptions   =   0 
         CacheSize       =   50 
         MaxRecords      =   0 
         BOFAction       =   0 
         EOFAction       =   0 
         ConnectStringType=   1 
         Appearance      =   1 
         BackColor       =   -2147483643 
         ForeColor       =   -2147483640 
         Orientation     =   0 
         Enabled         =   -1 
         Connect         =   "" 
         OLEDBString     =   "" 
         OLEDBFile       =   "" 
         DataSourceName  =   "" 
         OtherAttributes =   "" 
         UserName        =   "" 
         Password        =   "" 
         RecordSource    =   "" 
         Caption         =   "AdodcType" 
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
            Name            =   "宋体" 
            Size            =   9 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         _Version        =   393216 
      End 
      Begin MSDataListLib.DataCombo dco_Type  
         Height          =   330 
         Left            =   3240 
         TabIndex        =   6 
         Top             =   345 
         Width           =   1215 
         _ExtentX        =   2143 
         _ExtentY        =   582 
         _Version        =   393216 
         Style           =   2 
         ListField       =   "" 
         BoundColumn     =   "" 
         Text            =   "" 
      End 
      Begin VB.TextBox txtCarName  
         Height          =   300 
         Left            =   5640 
         TabIndex        =   4 
         Top             =   360 
         Width           =   1095 
      End 
      Begin VB.TextBox txtCarNo  
         Height          =   300 
         Left            =   960 
         TabIndex        =   2 
         Top             =   360 
         Width           =   1095 
      End 
      Begin VB.Label Label28  
         AutoSize        =   -1  'True 
         Caption         =   "状  态" 
         Height          =   180 
         Left            =   2580 
         TabIndex        =   56 
         Top             =   1200 
         Width           =   540 
      End 
      Begin VB.Label Label9  
         AutoSize        =   -1  'True 
         Caption         =   "购买日期" 
         Height          =   180 
         Left            =   7080 
         TabIndex        =   16 
         Top             =   760 
         Width           =   720 
      End 
      Begin VB.Label Label8  
         AutoSize        =   -1  'True 
         Caption         =   "销 售 商" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   15 
         Top             =   1200 
         Width           =   720 
      End 
      Begin VB.Label Label7  
         AutoSize        =   -1  'True 
         Caption         =   "车架编号" 
         Height          =   180 
         Left            =   2400 
         TabIndex        =   13 
         Top             =   810 
         Width           =   720 
      End 
      Begin VB.Label Label6  
         AutoSize        =   -1  'True 
         Caption         =   "发动机号" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   11 
         Top             =   810 
         Width           =   720 
      End 
      Begin VB.Label Label5  
         AutoSize        =   -1  'True 
         Caption         =   "燃油编号" 
         Height          =   180 
         Left            =   4800 
         TabIndex        =   9 
         Top             =   810 
         Width           =   720 
      End 
      Begin VB.Label Label4  
         AutoSize        =   -1  'True 
         Caption         =   "车辆颜色" 
         Height          =   180 
         Left            =   7080 
         TabIndex        =   7 
         Top             =   420 
         Width           =   720 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Caption         =   "车辆类型" 
         Height          =   180 
         Left            =   2400 
         TabIndex        =   5 
         Top             =   420 
         Width           =   720 
      End 
      Begin VB.Label Label2  
         AutoSize        =   -1  'True 
         Caption         =   "车辆名称" 
         Height          =   180 
         Left            =   4800 
         TabIndex        =   3 
         Top             =   420 
         Width           =   720 
      End 
      Begin VB.Label Label1  
         AutoSize        =   -1  'True 
         Caption         =   "车牌号码" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   1 
         Top             =   420 
         Width           =   720 
      End 
   End 
End 
Attribute VB_Name = "FrmCarEdit" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Public Modify As Boolean 
Public IIkeys As String 
Public sCarNo As String 
 
Private Sub Cmd_Exit_Click() 
  Unload Me 
End Sub 
 
Private Sub Cmd_OK_Click() 
  If Len(Trim(dco_Type.Text)) = 0 Then 
    MsgBox "请选择车辆类型" 
    dco_Type.SetFocus 
    Exit Sub 
  End If 
  If Len(Trim(txtCarName)) = 0 Then 
    MsgBox "请输入车辆名称" 
    txtCarName.SetFocus 
    txtCarName.SelStart = 0 
    txtCarName.SelLength = Len(txtCarName) 
    Exit Sub 
  End If 
  If Len(Trim(cbo_Color.Text)) = 0 Then 
    MsgBox "请选择车辆颜色" 
    cbo_Color.SetFocus 
    Exit Sub 
  End If 
  If Len(Trim(txtEDate)) = 0 Then 
    MsgBox "请输入结束日期" 
    txtEDate.SetFocus 
    Exit Sub 
  End If 
  If Len(Trim(txtEngineNo)) = 0 Then 
    MsgBox "请输入发动机号" 
    txtEngineNo.SetFocus 
    txtEngineNo.SelStart = 0 
    txtEngineNo.SelLength = Len(txtEngineNo) 
    Exit Sub 
  End If 
  If Len(Trim(txtCarCase)) = 0 Then 
    MsgBox "请输入车架号" 
    txtCarCase.SetFocus 
    txtCarCase.SelStart = 0 
    txtCarCase.SelLength = Len(txtCarCase) 
    Exit Sub 
  End If 
  If Len(Trim(dco_Sale.Text)) = 0 Then 
    MsgBox "请输入销售商" 
    dco_Sale.SetFocus 
    Exit Sub 
  End If 
   
  With MyCar 
  .CarNo = MakeStr(txtCarNo) 
  .TypeId = Val(dco_Type.BoundText) 
  .CarName = MakeStr(txtCarName) 
  .Color = MakeStr(cbo_Color.Text) 
  .SaleId = Val(dco_Sale.BoundText) 
  .BuyDate = MakeStr(txtBuyDate) 
  .CarCase = MakeStr(txtCarCase) 
  .EngineNo = MakeStr(txtEngineNo) 
  .OilNo = MakeStr(txtOilNo) 
  .InsurNo = MakeStr(txtInsurNo) 
  .InsurId = Val(dco_Insu.BoundText) 
  .InsurType = IIkeys 
  .InsurSdate = MakeStr(txtSDate) 
  .InsurEdate = MakeStr(txtEDate) 
  .DayPrice = Val(txtDayPrice) 
  .WeekEndPrice = Val(txtWeekEndPrice) 
  .WeekPrice = Val(txtWeekPrice) 
  .MonthPrice = Val(txtMonthPrice) 
  .Deposit = Val(txtDeposit) 
  .DayKM = Val(txtDayKM) 
  .OverTimePrice = Val(txtOTPrice) 
  .OverKMPrice = Val(txtOKMPrice) 
  .Status = Trim(cob_Status.Text) 
  .Comment = MakeStr(txtComment) 
  If Modify = False Then 
    If Len(Trim(txtCarNo)) = 0 Then 
      MsgBox "请输入车牌号码!" 
      txtCarNo.SetFocus 
      txtCarNo.SelStart = 0 
      txtCarNo.SelLength = Len(txtCarNo) 
      Exit Sub 
    End If 
    If .In_DB(MakeStr(txtCarNo)) = False Then 
      .Insert 
    Else 
      MsgBox ("已经存在此车牌号码") 
      txtCarNo.SetFocus 
      Exit Sub 
    End If 
  Else 
    Call .Update(sCarNo) 
  End If 
   MsgBox "成功", vbInformation 
  End With 
  Unload Me 
End Sub 
 
Private Sub Cmd_Select_Click() 
  FrmTypeSel.Show 1 
  txtInsurType = Trim(sInsuItems) 
  IIkeys = Trim(sInsuKeys) 
End Sub 
 
Private Sub Form_Load() 
  DataSetup 
End Sub 
 
Private Sub DataSetup() 
  AdodcType.ConnectionString = Conn 
  AdodcType.RecordSource = "SELECT * FROM Types WHERE Typeid=1" 
  Set dco_Type.RowSource = AdodcType 
  dco_Type.ListField = "TypeName" 
  dco_Type.BoundColumn = "Id" 
  AdodcSales.ConnectionString = Conn 
  AdodcSales.RecordSource = "SELECT * FROM Company WHERE Typeid=1" 
  Set dco_Sale.RowSource = AdodcSales 
  dco_Sale.ListField = "Company" 
  dco_Sale.BoundColumn = "Id" 
  AdodcInsurance.ConnectionString = Conn 
  AdodcInsurance.RecordSource = "SELECT * FROM Company WHERE Typeid=2" 
  Set dco_Insu.RowSource = AdodcInsurance 
  dco_Insu.ListField = "Company" 
  dco_Insu.BoundColumn = "Id" 
End Sub