📄 j_xinxisz.frm
字号:
VERSION 5.00
Begin VB.Form J_xinxisz
BackColor = &H80000013&
Caption = "产品设置信息"
ClientHeight = 4635
ClientLeft = 60
ClientTop = 465
ClientWidth = 6660
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4635
ScaleWidth = 6660
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
BackColor = &H80000013&
Height = 855
Left = 120
TabIndex = 21
Top = 3600
Width = 6375
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 3600
TabIndex = 23
Top = 240
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 375
Left = 1320
TabIndex = 22
Top = 240
Width = 1215
End
End
Begin VB.Frame Frame1
BackColor = &H80000013&
Caption = "产品设置"
Height = 3615
Left = 120
TabIndex = 0
Top = 0
Width = 6375
Begin VB.TextBox Text9
Height = 735
Left = 1200
TabIndex = 20
Top = 2640
Width = 4695
End
Begin VB.TextBox Text8
Height = 375
Left = 4080
TabIndex = 18
Top = 2160
Width = 1815
End
Begin VB.TextBox Text7
Height = 375
Left = 1200
TabIndex = 16
Top = 2160
Width = 1695
End
Begin VB.TextBox Text6
Height = 375
Left = 4080
TabIndex = 14
Top = 1680
Width = 1815
End
Begin VB.TextBox Text5
Height = 375
Left = 1200
TabIndex = 12
Top = 1680
Width = 1695
End
Begin VB.TextBox Text4
Height = 375
Left = 1200
TabIndex = 10
Top = 1200
Width = 4695
End
Begin VB.ComboBox Combo1
Height = 300
Left = 3840
TabIndex = 8
Text = "选择产品类别"
Top = 720
Width = 2055
End
Begin VB.TextBox Text3
Height = 375
Left = 960
TabIndex = 6
Top = 600
Width = 1695
End
Begin VB.TextBox Text2
Height = 375
Left = 3840
TabIndex = 4
Top = 120
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 960
TabIndex = 2
Top = 120
Width = 1695
End
Begin VB.Label Label10
BackColor = &H80000013&
Caption = "备注信息:"
Height = 375
Left = 240
TabIndex = 19
Top = 2760
Width = 975
End
Begin VB.Label Label9
BackColor = &H80000013&
Caption = "设置日期:"
Height = 375
Left = 3240
TabIndex = 17
Top = 2280
Width = 975
End
Begin VB.Label Label8
BackColor = &H80000013&
Caption = "零霍价格:"
Height = 375
Left = 240
TabIndex = 15
Top = 2160
Width = 975
End
Begin VB.Label Label7
BackColor = &H80000013&
Caption = "分销价格:"
Height = 255
Left = 3240
TabIndex = 13
Top = 1800
Width = 855
End
Begin VB.Label Label6
BackColor = &H80000013&
Caption = "入库价格:"
Height = 255
Left = 240
TabIndex = 11
Top = 1800
Width = 855
End
Begin VB.Label Label5
BackColor = &H80000013&
Caption = "生产厂家:"
Height = 375
Left = 240
TabIndex = 9
Top = 1200
Width = 975
End
Begin VB.Label Label4
BackColor = &H80000013&
Caption = "类 别:"
Height = 375
Left = 3240
TabIndex = 7
Top = 720
Width = 735
End
Begin VB.Label Label3
BackColor = &H80000013&
Caption = "单 位:"
Height = 375
Left = 360
TabIndex = 5
Top = 600
Width = 735
End
Begin VB.Label Label2
BackColor = &H80000013&
Caption = "名 称:"
Height = 375
Left = 3240
TabIndex = 3
Top = 240
Width = 735
End
Begin VB.Label Label1
BackColor = &H80000013&
Caption = "款 号:"
Height = 255
Left = 360
TabIndex = 1
Top = 240
Width = 615
End
End
End
Attribute VB_Name = "J_xinxisz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
If Trim(Text1.Text) = "" Then
MsgBox "信息编号不能为空", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
If Not IsNumeric(Text5.Text) Then
MsgBox "请输入数字", vbOKOnly, ""
Text5.Text = ""
Text5.SetFocus
Exit Sub
End If
If Not IsNumeric(Text6.Text) Then
MsgBox "请输入数字", vbOKOnly, ""
Text6.Text = ""
Text6.SetFocus
Exit Sub
End If
If Not IsNumeric(Text7.Text) Then
MsgBox "请输入数字", vbOKOnly, ""
Text7.Text = ""
Text7.SetFocus
Exit Sub
End If
If Not IsDate(Text8.Text) Then
MsgBox "请按照yyyy-mm-dd格式输入日期", vbOKOnly, ""
Text8.Text = ""
Text8.SetFocus
Exit Sub
End If
txtSQL = "select * from g_cpxinxi where dm='" & Text1.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
mrc.AddNew
mrc.Fields(0) = Text1.Text
mrc.Fields(1) = Text2.Text
mrc.Fields(2) = Text3.Text
mrc.Fields(3) = Combo1.Text
mrc.Fields(4) = Trim(Text5.Text)
mrc.Fields(5) = Trim(Text6.Text)
mrc.Fields(6) = Text7.Text
mrc.Fields(7) = Text4.Text
mrc.Fields(8) = Text8.Text
mrc.Fields(9) = Text9.Text
mrc.Update
MsgBox "添加信息成功", vbOKOnly, ""
Unload Me
Else
MsgBox "产品编号重复", vbOKOnly, ""
Text1.SetFocus
Text1.Text = ""
mrc.Close
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim txtSQL As String
txtSQL = "select * from g_cpleibie"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
Do While Not mrc.EOF
Combo1.AddItem mrc.Fields(0)
mrc.MoveNext
Loop
End If
mrc.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -