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

📄 form1.frm

📁 自己写的请多指教
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Top             =   3720
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "公司主营:"
         Height          =   255
         Index           =   8
         Left            =   360
         TabIndex        =   46
         Top             =   4200
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "资料渠道:"
         Height          =   255
         Index           =   9
         Left            =   360
         TabIndex        =   45
         Top             =   4560
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   " 资料查询人:"
         Height          =   255
         Index           =   10
         Left            =   120
         TabIndex        =   44
         Top             =   4920
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "初访时间:"
         Height          =   255
         Index           =   11
         Left            =   4200
         TabIndex        =   43
         Top             =   480
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "  初访人:"
         Height          =   255
         Index           =   12
         Left            =   4200
         TabIndex        =   42
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "制图软件:"
         Height          =   255
         Index           =   13
         Left            =   4200
         TabIndex        =   41
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "设计电脑台数:"
         Height          =   255
         Index           =   14
         Left            =   3840
         TabIndex        =   40
         Top             =   1920
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "设计人数:"
         Height          =   255
         Index           =   15
         Left            =   4200
         TabIndex        =   39
         Top             =   2400
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "回访时间:"
         Height          =   255
         Index           =   16
         Left            =   4200
         TabIndex        =   38
         Top             =   2880
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "  回访人:"
         Height          =   255
         Index           =   17
         Left            =   4200
         TabIndex        =   37
         Top             =   3360
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "试用时间:"
         Height          =   255
         Index           =   18
         Left            =   4200
         TabIndex        =   36
         Top             =   3840
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "购买时间:"
         Height          =   255
         Index           =   19
         Left            =   4200
         TabIndex        =   35
         Top             =   4320
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "点/台数:"
         Height          =   255
         Index           =   20
         Left            =   4320
         TabIndex        =   34
         Top             =   4800
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "公司名称:"
         Height          =   255
         Index           =   0
         Left            =   360
         TabIndex        =   18
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "公司地址:"
         Height          =   255
         Index           =   1
         Left            =   360
         TabIndex        =   17
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "部门名称:"
         Height          =   255
         Index           =   2
         Left            =   360
         TabIndex        =   16
         Top             =   1320
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "负责人:"
         Height          =   255
         Index           =   3
         Left            =   600
         TabIndex        =   15
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "电话:"
         Height          =   255
         Index           =   4
         Left            =   720
         TabIndex        =   14
         Top             =   2280
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "传真:"
         Height          =   255
         Index           =   5
         Left            =   720
         TabIndex        =   13
         Top             =   2760
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "邮箱:"
         Height          =   255
         Index           =   6
         Left            =   720
         TabIndex        =   12
         Top             =   3240
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "备注:"
         Height          =   255
         Index           =   22
         Left            =   720
         TabIndex        =   11
         Top             =   5280
         Width           =   615
      End
   End
   Begin VB.Label Label10 
      Caption         =   "客户信息录入"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   375
      Left            =   2400
      TabIndex        =   19
      Top             =   0
      Width           =   2175
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Combo1_KeyPress(Index As Integer, KeyAscii As Integer)
 If KeyAscii = 13 Then

 SendKeys "{TAB}"
 End If
End Sub

Private Sub Command1_Click()

   If Text1(0) = "" Then
     ss = MsgBox(Label1(0).Caption & "不能为空!", vbExclamation + vbOKOnly, "警告")
     Text1(0).SetFocus
     Text1(0).SelStart = 0
     Text1(0).SelLength = Len(Text1(0).Text)
    Exit Sub
   End If



Dim mrc As ADODB.Recordset

  txtsql1 = "select * from custom where 公司名称='" & Trim(Text1(0).Text) & "'"
  Set mrc = ExecuteSQL(txtsql1)
If modi = False Then
  If mrc.EOF = False Then
   sss = MsgBox("已经存在该公司的记录,公司名称不能重复!", vbExclamation + vbOKOnly, "警告")
   Text1(0).SetFocus
    Text1(0).SelStart = 0
   Text1(0).SelLength = Len(Text1(0).Text)
   mrc.Close
   Exit Sub
 End If
 End If
 

'If modi = True Then

'txtsql1 = "update  custom  set 公司名称='" & Trim(Text1(0).Text) & "',公司地址='" & Trim(Text1(1).Text) & "',部门名称='" & Trim(Text1(2).Text) & "',负责人='" & Trim(Text1(3).Text) & "',电话=#" & Trim(Text1(4).Text) & "# ,传真='" & Trim(Text1(5).Text) & "' ,邮箱='" & Trim(Text1(6).Text) & "' ,网址='" & Trim(Text1(7).Text) & "' ,公司主营=" & Trim(Text1(8).Text) & " ,资料渠道='" & Trim(Text1(9).Text) & "',资料查询者='" & Trim(Text1(10).Text) & "',初访时间='" & Trim(Text1(11).Text) & "',初访人='" & Trim(Text1(12).Text) & "',制图软件='" & Trim(Text1(13).Text) & "',设计电脑台数='" & Trim(Text1(14).Text) & "',设计人数='" & Trim(Text1(15).Text) & "',回访时间='" & Trim(Text1(16).Text) & "',回访人='" & Trim(Text1(17).Text) & "',使用时间='" & Trim(Text1(18).Text) & "',采购时间='" & Trim(Text1(19).Text) & "',点/台数='" & Trim(Text1(20).Text) & "',版本='" & Trim(Text1(21).Text) & "',备注='" & Trim(Text1(22).Text) & "',where 学号='" & Trim(Form3.MSF1.TextMatrix(Form3.MSF1.Row, 1)) & "'"
'Set mrc = ExecuteSQL(txtsql1)
'Unload Me
'Exit Sub
'End If

txtsql1 = "select * from custom "

Set mrc = ExecuteSQL(txtsql1)

  mrc.AddNew

 For i = 0 To 22
    mrc.Fields(i) = Trim(Text1(i).Text)
  Next i
     mrc.Update
  Set mrc = Nothing

 For j = 0 To 22
   Text1(j) = ""
Next
End Sub


Private Sub Command2_Click()
Unload Me
   
End Sub

Private Sub Form_Activate()
Text1(0).SetFocus
Form1.load1
End Sub

Public Sub load1()
Dim mrc As ADODB.Recordset
 txtsql1 = "select DISTINCT 班级 from class order by 班级"
 Set mrc = ExecuteSQL(txtsql1)
 If mrc.EOF Then
  ddd = MsgBox("请先设置班级部署!", "警告")
   mrc.Close
  Exit Sub
 End If
   Combo1(1).Clear
   mrc.MoveFirst
 Do While Not mrc.EOF
   Combo1(1).AddItem mrc.Fields(0)
   mrc.MoveNext
 Loop
     Combo1(1).ListIndex = 0
     Combo1(0).ListIndex = 0
If modi Then  '如果是修改状态
  Me.Caption = "修改"
  txtsql1 = "select * from xj where 学号='" & Trim(Form3.MSF1.TextMatrix(Form3.MSF1.Row, 1)) & "'"
  Set mrc = ExecuteSQL(txtsql1)
  mrc.MoveFirst
  For i = 4 To 9
   Text1(i - 2).Text = mrc.Fields(i)
  Next i
  Text1(0).Text = mrc.Fields(0)
  Text1(1).Text = mrc.Fields(1)
   Combo1(0).Text = mrc.Fields(2)
   Combo1(1).Text = mrc.Fields(3)
 mrc.Close
Else
  Me.Caption = "登记"
  For i = 2 To 7
   Text1(i).Text = ""
  Next i
  Text1(6).Text = Date
  Text1(0).Text = ""
  Text1(1).Text = ""
   
 End If
End Sub

Private Sub Text1_GotFocus(Index As Integer)
 If Index = 6 Then
  
   Text1(6).SelStart = 0
   Text1(6).SelLength = Len(Text1(6).Text)
  
 End If
End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
 If KeyAscii = 13 Then

 SendKeys "{TAB}"
 End If
End Sub


⌨️ 快捷键说明

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