?? xgspxx.frm
字號:
VERSION 5.00
Begin VB.Form xgspxx
BorderStyle = 1 'Fixed Single
Caption = "修改商品信息"
ClientHeight = 4290
ClientLeft = 2835
ClientTop = 3000
ClientWidth = 4845
Icon = "xgspxx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4290
ScaleWidth = 4845
Begin VB.CommandButton Command3
Caption = "返回(&B)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 14
Top = 3720
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "保存(&S)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 13
Top = 3720
Width = 1215
End
Begin VB.Frame Frame1
Height = 3615
Left = 0
TabIndex = 0
Top = 0
Width = 4815
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 735
Left = 1680
MultiLine = -1 'True
TabIndex = 6
Top = 2760
Width = 2655
End
Begin VB.TextBox Text7
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 5
Top = 2280
Width = 2655
End
Begin VB.TextBox Text6
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 3
Top = 1320
Width = 2655
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 2520
Visible = 0 'False
Width = 1260
End
Begin VB.TextBox Text5
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 1
Top = 240
Width = 2655
End
Begin VB.TextBox Text4
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 2
Top = 840
Width = 2655
End
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 4
Top = 1800
Width = 2655
End
Begin VB.Label Label7
Caption = "產(chǎn)地"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 12
Top = 2280
Width = 615
End
Begin VB.Label Label6
Caption = "計量單位"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 360
TabIndex = 11
Top = 1800
Width = 1095
End
Begin VB.Label Label5
Caption = "備注:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 10
Top = 2880
Width = 735
End
Begin VB.Label Label3
Caption = "供貨商"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 9
Top = 1320
Width = 855
End
Begin VB.Label Label2
Caption = "商品名稱"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 8
Top = 840
Width = 1095
End
Begin VB.Label Label1
Caption = "商品編號"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 7
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "xgspxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bc As Boolean
Private Sub Command1_Click()
'czrygl.Data1.Recordset.MoveLast
xgspxx.Data1.Recordset.FindFirst "spbh = " & "'" & Text5.Text & "'"
bc = True
If Text5.Text = "" Then
MsgBox "商品名稱不能為空。", vbCritical, "警告"
Text5.SetFocus
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "商品名稱不能為空。", vbCritical, "警告"
Text4.SetFocus
Exit Sub
End If
If Len(Text1.Text) > 50 Then
MsgBox "備注不要多于25個字", vbCritical, "警告"
Text1.SetFocus
Exit Sub
End If
xgspxx.Data1.Recordset.Edit
xgspxx.Data1.Recordset("spbh") = Trim(Text5.Text)
xgspxx.Data1.Recordset("spmc") = Trim(Text4.Text)
'If Option1.Value = True Then
xgspxx.Data1.Recordset("ghs") = Trim(Text6.Text)
' Else
' tjzy.Data1.Recordset("xb") = "女"
'End If
xgspxx.Data1.Recordset("dw") = Trim(Text3.Text)
'xgspxx.Data1.Recordset("ys") = Trim(Text2.Text)
xgspxx.Data1.Recordset("spcd") = Trim(Text7.Text)
xgspxx.Data1.Recordset("bz") = Trim(Text1.Text)
xgspxx.Data1.Recordset.Update
'Call Form_Activate
xgspxx.Data1.Refresh
Unload Me
spxx.Show
End Sub
Private Sub Command2_Click()
End Sub
Private Sub Command3_Click()
'自動生成編號
If bc = False Then
MsgBox "請先將當前記錄保存。", vbInformation, "提示"
Exit Sub
End If
spxx.Show
bc = False
Unload Me
End Sub
Private Sub Form_Activate()
'載入當前商品信息
xgspxx.Text5.Text = xgspxx.Data1.Recordset("spbh")
xgspxx.Text4.Text = xgspxx.Data1.Recordset("spmc")
xgspxx.Text6.Text = xgspxx.Data1.Recordset("ghs")
xgspxx.Text3.Text = xgspxx.Data1.Recordset("dw")
'xgspxx.Text2.Text = xgspxx.Data1.Recordset("ys")
xgspxx.Text7.Text = xgspxx.Data1.Recordset("spcd")
'xgspxx.Data1.Recordset ("bz")
'xgspxx.Text1.Text = ""
On Error Resume Next
xgspxx.Text1.Text = xgspxx.Data1.Recordset("bz")
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
'Text5.SetFocus
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -