📄 添加供货商信息.frm
字号:
VERSION 5.00
Begin VB.Form frmAddGongShang
BorderStyle = 1 'Fixed Single
Caption = "添加供货商信息..."
ClientHeight = 3450
ClientLeft = 45
ClientTop = 435
ClientWidth = 4680
Icon = "添加供货商信息.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 3450
ScaleWidth = 4680
Begin VB.Frame FramEdit
Caption = "修改供货商信息:"
ForeColor = &H00FF0000&
Height = 2535
Left = 120
TabIndex = 0
Top = 120
Width = 3855
Begin VB.TextBox TxtByTelEd
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 10
Top = 1177
Width = 1335
End
Begin VB.TextBox TxtCompanyEd
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 11
Top = 1560
Width = 1335
End
Begin VB.TextBox TxtByNameEd
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 9
Top = 746
Width = 1335
End
Begin VB.TextBox TxtByEmailEd
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 12
Top = 1995
Width = 1335
End
Begin VB.CommandButton CmdQuXiao
Caption = "取 消"
Height = 300
Left = 2880
TabIndex = 14
Top = 1980
Width = 800
End
Begin VB.CommandButton CmdOkEd
Caption = "确 定"
Height = 300
Left = 2880
TabIndex = 13
Top = 1560
Width = 800
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "供货商编号:"
Height = 180
Left = 240
TabIndex = 19
Top = 360
Width = 1080
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "供货商姓名:"
Height = 180
Left = 240
TabIndex = 18
Top = 780
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "开 户 行:"
Height = 180
Left = 240
TabIndex = 17
Top = 1620
Width = 1080
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = " 银行帐号:"
Height = 180
Left = 240
TabIndex = 16
Top = 1200
Width = 990
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "供货商单位:"
Height = 180
Left = 240
TabIndex = 15
Top = 2040
Width = 1080
End
Begin VB.Image Image2
Height = 780
Left = 2880
Picture = "添加供货商信息.frx":058A
Top = 360
Width = 780
End
Begin VB.Label LabByIdEd
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H000080FF&
Height = 255
Left = 1320
TabIndex = 8
Top = 360
Width = 1335
End
End
Begin VB.Frame FramAddGongHuoShang
Caption = "添加供货商信息:"
ForeColor = &H00FF0000&
Height = 2535
Left = 120
TabIndex = 20
Top = 120
Width = 3855
Begin VB.CommandButton CmdOk
Caption = "确 定"
Height = 300
Left = 2880
TabIndex = 6
Top = 1560
Width = 800
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 300
Left = 2880
TabIndex = 7
Top = 1980
Width = 800
End
Begin VB.TextBox TxtEmail
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 5
Top = 1995
Width = 1335
End
Begin VB.TextBox TxtByName
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 2
Top = 746
Width = 1335
End
Begin VB.TextBox TxtCompany
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 4
Top = 1560
Width = 1335
End
Begin VB.TextBox TxtByTel
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 3
Top = 1177
Width = 1335
End
Begin VB.TextBox TxtById
Appearance = 0 'Flat
ForeColor = &H000080FF&
Height = 270
Left = 1320
TabIndex = 1
Top = 315
Width = 1335
End
Begin VB.Image Image1
Height = 780
Left = 2880
Picture = "添加供货商信息.frx":14E3
Top = 360
Width = 780
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "供货商单位:"
Height = 180
Left = 240
TabIndex = 25
Top = 2040
Width = 1080
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = " 银行帐号:"
Height = 180
Left = 240
TabIndex = 24
Top = 1200
Width = 990
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "开 户 行:"
Height = 180
Left = 240
TabIndex = 23
Top = 1620
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "供货商姓名:"
Height = 180
Left = 240
TabIndex = 22
Top = 780
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "供货商编号:"
Height = 180
Left = 240
TabIndex = 21
Top = 360
Width = 1080
End
End
Begin VB.Label LabId
Caption = "Label11"
Height = 375
Left = 960
TabIndex = 26
Top = 3120
Width = 735
End
End
Attribute VB_Name = "frmAddGongShang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdOk_Click()
FrmGongHuoShang.Adodc1.CommandType = adCmdText
FrmGongHuoShang.Adodc1.RecordSource = "select * from gonghuoshang"
FrmGongHuoShang.Adodc1.Refresh
If TxtById = "" Then
MsgBox "请输入客户ID", vbOKOnly + vbExclamation, "提示"
Else
Dim n%
For n = 1 To FrmGongHuoShang.Adodc1.Recordset.RecordCount
If Val(TxtById) = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_id") Then
MsgBox "这个编号已经有了,请重新输入", vbInformation, "编号重复"
Exit Sub
Else
FrmGongHuoShang.Adodc1.Recordset.MoveNext
End If
Next n
FrmGongHuoShang.Adodc1.Recordset.AddNew
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_id") = TxtById
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_name") = TxtByName
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_acl") = TxtCompany
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_bank") = TxtByTel
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_company") = TxtEmail
AddorEdit = "添加"
Unload Me
End If
End Sub
Private Sub CmdOkEd_Click()
FrmGongHuoShang.Adodc1.Recordset.Update
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_id") = LabByIdEd
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_name") = TxtByNameEd
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_acl") = TxtByTelEd
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_bank") = TxtCompanyEd
FrmGongHuoShang.Adodc1.Recordset.Fields("pro_company") = TxtByEmailEd
AddorEdit = "修改"
Unload Me
End Sub
Private Sub CmdQuXiao_Click()
Call Command2_Click
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
frmAddGongShang.Height = 3250
frmAddGongShang.Width = 4185
frmAddGongShang.Top = 1500
frmAddGongShang.Left = 3800
LabByIdEd = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_id")
TxtByNameEd = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_name")
TxtByTelEd = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_acl")
TxtCompanyEd = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_bank")
TxtByEmailEd = FrmGongHuoShang.Adodc1.Recordset.Fields("pro_company")
LabId = LabByIdEd
End Sub
Private Sub TxtById_KeyPress(KeyAscii As Integer)
Select Case Chr(KeyAscii)
Case "0" To "9", Chr(8), Chr(46)
Case Else
KeyAscii = 0
End Select
End Sub
Private Sub TxtByTel_KeyPress(KeyAscii As Integer)
Select Case Chr(KeyAscii)
Case "0" To "9", Chr(8), Chr(46)
Case Else
KeyAscii = 0
End Select
End Sub
Private Sub TxtByTelEd_KeyPress(KeyAscii As Integer)
Select Case Chr(KeyAscii)
Case "0" To "9", Chr(8), Chr(46)
Case Else
KeyAscii = 0
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -