www.pudn.com > 数据库作业.rar > gkxx.frm


VERSION 5.00 
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX" 
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX" 
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx" 
Begin VB.Form gkxx  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "顾客信息" 
   ClientHeight    =   5085 
   ClientLeft      =   1650 
   ClientTop       =   2595 
   ClientWidth     =   6015 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   5085 
   ScaleMode       =   0  'User 
   ScaleWidth      =   6015 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.Data Data1  
      Caption         =   "Data1" 
      Connect         =   "Access" 
      DatabaseName    =   "医药信息管理系统.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   285 
      Left            =   4680 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "顾客信息" 
      Top             =   4800 
      Visible         =   0   'False 
      Width           =   1215 
   End 
   Begin VB.ComboBox Combo1  
      DataField       =   "性别" 
      DataSource      =   "Adodc1" 
      Height          =   300 
      ItemData        =   "gkxx.frx":0000 
      Left            =   1080 
      List            =   "gkxx.frx":000A 
      Style           =   2  'Dropdown List 
      TabIndex        =   10 
      Top             =   1560 
      Width           =   735 
   End 
   Begin MSDBCtls.DBCombo DBCombo2  
      Bindings        =   "gkxx.frx":0016 
      DataSource      =   "Adodc1" 
      Height          =   330 
      Left            =   1080 
      TabIndex        =   12 
      Top             =   2280 
      Width           =   1335 
      _ExtentX        =   2355 
      _ExtentY        =   582 
      _Version        =   393216 
      Style           =   2 
      ListField       =   "经办人" 
      BoundColumn     =   "" 
      Text            =   "" 
   End 
   Begin MSComCtl2.DTPicker DTPicker1  
      DataField       =   "录入时间" 
      DataSource      =   "Adodc1" 
      Height          =   375 
      Left            =   1080 
      TabIndex        =   13 
      Top             =   2640 
      Width           =   1335 
      _ExtentX        =   2355 
      _ExtentY        =   661 
      _Version        =   393216 
      Format          =   23789569 
      CurrentDate     =   38326 
   End 
   Begin VB.Frame Frame2  
      Height          =   1575 
      Left            =   120 
      TabIndex        =   31 
      Top             =   3360 
      Width           =   5775 
      Begin VB.CommandButton Comcancel  
         Caption         =   "取消" 
         Height          =   495 
         Left            =   4440 
         TabIndex        =   18 
         Top             =   960 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comfirst  
         Caption         =   "第一页" 
         Height          =   495 
         Left            =   120 
         TabIndex        =   2 
         Top             =   240 
         Width           =   1215 
      End 
      Begin VB.CommandButton Compre  
         Caption         =   "上一页" 
         Height          =   495 
         Left            =   1560 
         TabIndex        =   3 
         Top             =   240 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comnext  
         Caption         =   "下一页" 
         Height          =   495 
         Left            =   3000 
         TabIndex        =   4 
         Top             =   240 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comlast  
         Caption         =   "最后一页" 
         Height          =   495 
         Left            =   4440 
         TabIndex        =   5 
         Top             =   240 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comsave  
         Caption         =   "保存" 
         Height          =   495 
         Left            =   3000 
         TabIndex        =   1 
         Top             =   960 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comadd  
         Caption         =   "添加" 
         Height          =   495 
         Left            =   120 
         TabIndex        =   6 
         Top             =   960 
         Width           =   1215 
      End 
      Begin VB.CommandButton Comdel  
         Caption         =   "删除" 
         Height          =   495 
         Left            =   1560 
         TabIndex        =   7 
         Top             =   960 
         Width           =   1215 
      End 
   End 
   Begin VB.Frame Frame1  
      Caption         =   "顾客信息" 
      Height          =   3135 
      Left            =   120 
      TabIndex        =   0 
      Top             =   120 
      Width           =   5775 
      Begin VB.TextBox Text1  
         BackColor       =   &H8000000B& 
         DataField       =   "编号" 
         DataSource      =   "Adodc1" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   960 
         Locked          =   -1  'True 
         TabIndex        =   19 
         Text            =   "Text1" 
         Top             =   360 
         Width           =   1215 
      End 
      Begin VB.TextBox Text2  
         DataField       =   "姓名" 
         DataSource      =   "Adodc1" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   960 
         TabIndex        =   8 
         Text            =   "Text2" 
         Top             =   720 
         Width           =   975 
      End 
      Begin VB.TextBox Text3  
         DataField       =   "年龄" 
         DataSource      =   "Adodc1" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   960 
         TabIndex        =   9 
         Text            =   "Text3" 
         Top             =   1080 
         Width           =   495 
      End 
      Begin VB.TextBox Text4  
         DataField       =   "电话" 
         DataSource      =   "Adodc1" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   960 
         TabIndex        =   11 
         Text            =   "Text4" 
         Top             =   1800 
         Width           =   1335 
      End 
      Begin VB.TextBox Text5  
         DataField       =   "住址" 
         DataSource      =   "Adodc1" 
         Height          =   495 
         Left            =   3720 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   14 
         Text            =   "gkxx.frx":002A 
         Top             =   360 
         Width           =   1935 
      End 
      Begin VB.TextBox Text7  
         DataField       =   "症状" 
         DataSource      =   "Adodc1" 
         Height          =   495 
         Left            =   3720 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   15 
         Text            =   "gkxx.frx":0030 
         Top             =   960 
         Width           =   1935 
      End 
      Begin VB.TextBox Text8  
         DataField       =   "对已购产品及服务评价" 
         DataSource      =   "Adodc1" 
         Height          =   495 
         Left            =   3720 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   17 
         Text            =   "gkxx.frx":0036 
         Top             =   2400 
         Width           =   1935 
      End 
      Begin VB.TextBox Text9  
         DataField       =   "备注" 
         DataSource      =   "Adodc1" 
         Height          =   495 
         Left            =   3720 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   16 
         Text            =   "gkxx.frx":003C 
         Top             =   1560 
         Width           =   1935 
      End 
      Begin VB.Label Label1  
         Caption         =   "编号" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   30 
         Top             =   360 
         Width           =   495 
      End 
      Begin VB.Label Label2  
         Caption         =   "姓名" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   29 
         Top             =   720 
         Width           =   495 
      End 
      Begin VB.Label Label3  
         Caption         =   "性别" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   28 
         Top             =   1440 
         Width           =   495 
      End 
      Begin VB.Label Label4  
         Caption         =   "年龄" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   27 
         Top             =   1080 
         Width           =   495 
      End 
      Begin VB.Label Label5  
         Caption         =   "住址" 
         Height          =   255 
         Left            =   3120 
         TabIndex        =   26 
         Top             =   360 
         Width           =   495 
      End 
      Begin VB.Label Label6  
         Caption         =   "电话" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   25 
         Top             =   1800 
         Width           =   495 
      End 
      Begin VB.Label Label7  
         Caption         =   "经办人" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   24 
         Top             =   2160 
         Width           =   615 
      End 
      Begin VB.Label Label8  
         Caption         =   "症状" 
         Height          =   255 
         Left            =   3120 
         TabIndex        =   23 
         Top             =   960 
         Width           =   495 
      End 
      Begin VB.Label Label9  
         Caption         =   "录入时间" 
         Height          =   255 
         Left            =   120 
         TabIndex        =   22 
         Top             =   2520 
         Width           =   735 
      End 
      Begin VB.Label Label10  
         Caption         =   "备注" 
         Height          =   255 
         Left            =   3120 
         TabIndex        =   21 
         Top             =   1560 
         Width           =   495 
      End 
      Begin VB.Label Label11  
         Caption         =   "对已购产品及服务评价" 
         Height          =   255 
         Left            =   3120 
         TabIndex        =   20 
         Top             =   2160 
         Width           =   1935 
      End 
   End 
   Begin MSAdodcLib.Adodc Adodc1  
      Height          =   375 
      Left            =   0 
      Top             =   4680 
      Visible         =   0   'False 
      Width           =   1575 
      _ExtentX        =   2778 
      _ExtentY        =   661 
      ConnectMode     =   0 
      CursorLocation  =   3 
      IsolationLevel  =   -1 
      ConnectionTimeout=   15 
      CommandTimeout  =   30 
      CursorType      =   3 
      LockType        =   2 
      CommandType     =   2 
      CursorOptions   =   0 
      CacheSize       =   50 
      MaxRecords      =   0 
      BOFAction       =   0 
      EOFAction       =   0 
      ConnectStringType=   1 
      Appearance      =   1 
      BackColor       =   -2147483643 
      ForeColor       =   -2147483640 
      Orientation     =   0 
      Enabled         =   -1 
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=医药信息管理系统.mdb;Persist Security Info=False" 
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=医药信息管理系统.mdb;Persist Security Info=False" 
      OLEDBFile       =   "" 
      DataSourceName  =   "" 
      OtherAttributes =   "" 
      UserName        =   "" 
      Password        =   "" 
      RecordSource    =   "顾客信息" 
      Caption         =   "Adodc1" 
      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 
End 
Attribute VB_Name = "gkxx" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim b As Integer 
Dim c As Integer 
Private Sub Comadd_Click() 
    Comdel.Enabled = False 
    Comfirst.Enabled = False 
    Comnext.Enabled = False 
    Comlast.Enabled = False 
    Compre.Enabled = False 
    Comadd.Enabled = False 
    Comcancel.Enabled = True 
    b = Adodc1.Recordset.AbsolutePosition 
    c = Adodc1.Recordset.RecordCount + 1 
    Adodc1.Recordset.MoveLast 
    a = Adodc1.Recordset("编号") 
    Adodc1.Recordset.AddNew 
    Adodc1.Recordset("编号") = a + 1 
    Adodc1.Recordset("性别") = "男" 
    Adodc1.Recordset("录入时间") = Date 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comdel_Click() 
    Y = MsgBox("要删除该记录吗?", 36, "删除记录") 
    If Y = vbYes Then 
        If Adodc1.Recordset.AbsolutePosition < Adodc1.Recordset.RecordCount Then 
            Adodc1.Recordset.Delete 
            Adodc1.Recordset.MoveNext 
        Else 
            Adodc1.Recordset.Delete 
            Adodc1.Recordset.MoveLast 
        End If 
    End If 
    If Adodc1.Recordset.RecordCount = 1 Then 
        Comdel.Enabled = False 
    End If 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comfirst_Click() 
    Adodc1.Recordset.MoveFirst 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Compre_Click() 
    If Adodc1.Recordset.AbsolutePosition > 1 Then 
        Adodc1.Recordset.MovePrevious 
    Else 
        Adodc1.Recordset.MoveFirst 
    End If 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comnext_Click() 
    If Adodc1.Recordset.AbsolutePosition < Adodc1.Recordset.RecordCount Then 
        Adodc1.Recordset.MoveNext 
    Else 
        Adodc1.Recordset.MoveLast 
    End If 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comlast_Click() 
    Adodc1.Recordset.MoveLast 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comcancel_Click() 
    Adodc1.Recordset.Delete 
    Adodc1.Recordset.Move (b - c) 
    Comdel.Enabled = True 
    Comfirst.Enabled = True 
    Comnext.Enabled = True 
    Comlast.Enabled = True 
    Compre.Enabled = True 
    Comadd.Enabled = True 
    Comcancel.Enabled = False 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
Private Sub Comsave_Click() 
    If Text2.Text = "" Then 
        MsgBox ("请输入姓名!"), 16, ("错误") 
    ElseIf Text3.Text = "" Then 
        MsgBox ("请输入年龄!"), 16, ("错误") 
    ElseIf Combo1.Text = "" Then 
        MsgBox ("请选择性别!"), 16, ("错误") 
    ElseIf Text4.Text = "" Then 
        MsgBox ("请输入电话!"), 16, ("错误") 
    ElseIf DBCombo2.Text = "" Then 
        MsgBox ("请选择经办人!"), 16, ("错误") 
    Else 
        Adodc1.Recordset("经办人") = DBCombo2.Text 
        Adodc1.Recordset.UpdateBatch 
        Comdel.Enabled = True 
        Comfirst.Enabled = True 
        Comnext.Enabled = True 
        Comlast.Enabled = True 
        Compre.Enabled = True 
        Comadd.Enabled = True 
        Comcancel.Enabled = False 
    End If 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub 
 
 
Private Sub Form_Load() 
On Error Resume Next 
    Comcancel.Enabled = False 
    If csxx.d = 0 Then 
        Adodc1.Recordset.Find "编号 = '" & csxx.Adodc1.Recordset("编号") & "'" 
    End If 
    DBCombo2.Text = Adodc1.Recordset("经办人") 
    Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页  共" & Adodc1.Recordset.RecordCount & "页" 
End Sub