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

📄 frmkhda.frm

📁 很好用的通用库存管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmKHDA 
   BorderStyle     =   0  'None
   Caption         =   "客户档案"
   ClientHeight    =   5760
   ClientLeft      =   2145
   ClientTop       =   2985
   ClientWidth     =   10185
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5760
   ScaleWidth      =   10185
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command1 
      Caption         =   "打 印"
      Height          =   375
      Left            =   6000
      TabIndex        =   3
      Top             =   5280
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "关 闭"
      Height          =   375
      Left            =   8760
      TabIndex        =   1
      Top             =   5280
      Width           =   975
   End
   Begin VB.CommandButton Command4 
      Caption         =   "新 添"
      Height          =   375
      Left            =   7440
      TabIndex        =   0
      Top             =   5280
      Width           =   855
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      BackColor       =   &H80000000&
      ForeColor       =   &H80000008&
      Height          =   3855
      Left            =   210
      ScaleHeight     =   3825
      ScaleWidth      =   9825
      TabIndex        =   4
      Top             =   960
      Width           =   9855
      Begin VB.VScrollBar VScroll1 
         Height          =   3855
         LargeChange     =   2400
         Left            =   9600
         Max             =   255
         SmallChange     =   255
         TabIndex        =   14
         Top             =   0
         Width           =   255
      End
      Begin VB.PictureBox Picture1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000000&
         ForeColor       =   &H80000008&
         Height          =   4080
         Left            =   0
         ScaleHeight     =   4050
         ScaleWidth      =   9465
         TabIndex        =   5
         Top             =   -255
         Width           =   9495
         Begin VB.Label LabXG 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H00FFFFC0&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "修改"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   8520
            TabIndex        =   13
            Top             =   0
            Width           =   495
         End
         Begin VB.Label LabDel 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H00C0C0FF&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "删除"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   9000
            TabIndex        =   12
            Top             =   0
            Width           =   495
         End
         Begin VB.Label LabBh 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "编号"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   0
            TabIndex        =   11
            Top             =   0
            Width           =   615
         End
         Begin VB.Label LabName 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "客户名称"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   600
            TabIndex        =   10
            Top             =   0
            Width           =   2295
         End
         Begin VB.Label LabAddress 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "客户地址"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   2880
            TabIndex        =   9
            Top             =   0
            Width           =   2535
         End
         Begin VB.Label LabTele 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "电话"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   5400
            TabIndex        =   8
            Top             =   0
            Width           =   1335
         End
         Begin VB.Label LabLXR 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "联系人"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   6720
            TabIndex        =   7
            Top             =   0
            Width           =   855
         End
         Begin VB.Label LabBZ 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "备注"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   7560
            TabIndex        =   6
            Top             =   0
            Width           =   975
         End
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "操  作"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   8760
      TabIndex        =   21
      Top             =   720
      Width           =   975
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "备注"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   7800
      TabIndex        =   20
      Top             =   720
      Width           =   975
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "联系人"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   6960
      TabIndex        =   19
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "电话"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   18
      Top             =   720
      Width           =   1335
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "客户地址"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   3120
      TabIndex        =   17
      Top             =   720
      Width           =   2535
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "客户名称"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   840
      TabIndex        =   16
      Top             =   720
      Width           =   2295
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "编号"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   240
      TabIndex        =   15
      Top             =   720
      Width           =   615
   End
   Begin VB.Label LabNmae 
      Caption         =   "临沂市长安物贸有限公司客户档案"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   3000
      TabIndex        =   2
      Top             =   240
      Width           =   3975
   End
End
Attribute VB_Name = "FrmKHDA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer

Private Sub Command1_Click()
 SqlBase = "SELECT * FROM 客户表"
 PublicPath = App.Path & "\khda.rpt"
 FrmPrinter.Show
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
FrmKHAdd.Show
Unload Me
End Sub

Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Set Rs = New Recordset
VScroll1.Visible = False
Set_Init
End Sub
Private Sub Set_Init()
sSql = "SELECT * FROM 客户表"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
  i = 1
  Do While Not Rs.EOF
    
    Load LabBh(i)
    Load LabName(i)
    Load LabAddress(i)
    Load LabTele(i)
    Load LabLXR(i)
    Load LabBZ(i)
    Load LabXG(i)
    Load LabDel(i)
    
   LabBh(i).Top = LabBh(i - 1).Top + 255
   LabName(i).Top = LabName(i - 1).Top + 255
   LabAddress(i).Top = LabAddress(i - 1).Top + 255
   LabTele(i).Top = LabTele(i - 1).Top + 255
   LabLXR(i).Top = LabLXR(i - 1).Top + 255
   LabBZ(i).Top = LabBZ(i - 1).Top + 255
   LabXG(i).Top = LabXG(i - 1).Top + 255
   LabDel(i).Top = LabDel(i - 1).Top + 255
   
    LabBh(i).Visible = True:
    LabName(i).Visible = True
    LabAddress(i).Visible = True
    LabTele(i).Visible = True
    LabLXR(i).Visible = True
    LabBZ(i).Visible = True
    LabXG(i).Visible = True
    LabDel(i).Visible = True
      
    LabBh(i) = i
    LabName(i) = Rs("客户名称")
    LabAddress(i) = Rs("客户地址")
    LabTele(i) = Rs("电话")
    LabLXR(i) = Rs("联系人")
    If Rs("备注") = "-" Then LabBZ(i) = "" Else LabBZ(i) = Rs("备注")
    LabXG(i).LinkItem = Rs("ID")
    LabDel(i).LinkItem = Rs("ID")
    i = i + 1
    If i > 16 Then
     Picture1.Height = Picture1.Height + 255
     VScroll1.Visible = True
   VScroll1.Max = (i - 16) * 255
   End If
    Rs.MoveNext
  Loop
 
 Rs.Close
End Sub

Private Sub LabDel_Click(Index As Integer)
Dim a As Integer
 a = MsgBox("********你确定要删除此客户档案信息吗?**********" & vbCrLf _
        & "一旦删除将不可更改!" & vbCrLf _
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
    sSql = "delete FROM 客户表 where ID =" & Val(LabDel(Index).LinkItem)
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Set_Unload
Set_Init
End If
If a = 2 Then Exit Sub
End Sub

Private Sub LabXG_Click(Index As Integer)
RemId = Val(LabXG(Index).LinkItem)
FrmKHDAXG.Show
Unload Me
End Sub
Private Sub Set_Unload() '卸载各lab
 For i = 1 To LabBh.Count - 1
    Unload LabBh(i)
    Unload LabName(i)
    Unload LabAddress(i)
    Unload LabTele(i)
    Unload LabLXR(i)
    Unload LabBZ(i)
    Unload LabXG(i)
    Unload LabDel(i)
 Next i
End Sub
Private Sub VScroll1_Change()
Picture1.Top = VScroll1.Value * (-1) - 255
End Sub
Private Sub VScroll1_Scroll()
Picture1.Top = VScroll1.Value * (-1) - 255
End Sub

⌨️ 快捷键说明

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