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

📄 frm_supply_add.frm

📁 前些年帮人写的毕业设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frm_Supply_Add 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "供应商信息添加"
   ClientHeight    =   3000
   ClientLeft      =   3795
   ClientTop       =   2730
   ClientWidth     =   5010
   Icon            =   "Frm_supply_Add.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3000
   ScaleWidth      =   5010
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2940
      TabIndex        =   13
      Top             =   2460
      Width           =   1035
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   12
      Top             =   2460
      Width           =   1035
   End
   Begin VB.TextBox Text6 
      Height          =   1575
      Left            =   3000
      TabIndex        =   11
      Top             =   600
      Width           =   1815
   End
   Begin VB.TextBox Text5 
      Height          =   300
      Left            =   900
      TabIndex        =   9
      Top             =   1860
      Width           =   1815
   End
   Begin VB.TextBox Text4 
      Height          =   300
      Left            =   900
      TabIndex        =   7
      Top             =   1440
      Width           =   1815
   End
   Begin VB.TextBox Text3 
      Height          =   300
      Left            =   900
      TabIndex        =   5
      Top             =   1020
      Width           =   1815
   End
   Begin VB.TextBox Text2 
      Height          =   300
      Left            =   900
      TabIndex        =   3
      Top             =   600
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      Height          =   300
      Left            =   900
      TabIndex        =   1
      Top             =   180
      Width           =   1815
   End
   Begin VB.Label Label6 
      Caption         =   "地址"
      Height          =   195
      Left            =   3000
      TabIndex        =   10
      Top             =   240
      Width           =   675
   End
   Begin VB.Label Label5 
      Caption         =   "电话"
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   1980
      Width           =   615
   End
   Begin VB.Label Label4 
      Caption         =   "联系人"
      Height          =   195
      Left            =   240
      TabIndex        =   6
      Top             =   1500
      Width           =   615
   End
   Begin VB.Label Label3 
      Caption         =   "法人"
      Height          =   195
      Left            =   240
      TabIndex        =   4
      Top             =   1020
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "全称"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   600
      Width           =   675
   End
   Begin VB.Label Label1 
      Caption         =   "简称"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   555
   End
End
Attribute VB_Name = "Frm_Supply_Add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    On Error GoTo myerr
    Dim cn As ADODB.Connection

    If Trim(Text1) = "" Then
        MsgBox "简称不能为空!", vbExclamation, "提示"
        Text1.SetFocus
        Exit Sub
    End If
    If Trim(Text2) = "" Then
        MsgBox "全称不能为空!", vbExclamation, "提示"
        Text2.SetFocus
        Exit Sub
    End If
    If Trim(Text3) = "" Then
        MsgBox "法人不能为空!", vbExclamation, "提示"
        Text3.SetFocus
        Exit Sub
    End If
    If Trim(Text4) = "" Then
        MsgBox "联系人不能为空!", vbExclamation, "提示"
        Text4.SetFocus
        Exit Sub
    End If
    If Trim(Text5) = "" Then
        MsgBox "电话不能为空!", vbExclamation, "提示"
        Text5.SetFocus
        Exit Sub
    End If
    If Trim(Text6) = "" Then
        MsgBox "地址不能为空!", vbExclamation, "提示"
        Text6.SetFocus
        Exit Sub
    End If
   
    If Len(Text1) > 50 Then
        MsgBox "简称超长!", vbExclamation, "提示"
        Text1.SetFocus
        Exit Sub
    End If
    If Len(Text2) > 200 Then
        MsgBox "全称超长!", vbExclamation, "提示"
        Text2.SetFocus
        Exit Sub
    End If
    If Len(Text3) > 50 Then
        MsgBox "法人超长!", vbExclamation, "提示"
        Text3.SetFocus
        Exit Sub
    End If
    If Len(Text4) > 50 Then
        MsgBox "联系人超长!", vbExclamation, "提示"
        Text4.SetFocus
        Exit Sub
    End If
    If Len(Text5) > 50 Then
        MsgBox "电话超长!", vbExclamation, "提示"
        Text5.SetFocus
        Exit Sub
    End If
    If Len(Text6) > 200 Then
        MsgBox "地址超长!", vbExclamation, "提示"
        Text6.SetFocus
        Exit Sub
    End If
    
    Set cn = GetCn
    cn.Execute "insert into supply (name,short_name,first_man,link_man,phone,addrs) values ('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "')"
    MsgBox "已成功保存!", vbExclamation, "提示"
    Unload Me
    Exit Sub
myerr:
    MsgBox Error, vbExclamation, "提示"
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

⌨️ 快捷键说明

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