📄 frmshop.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmShop
BackColor = &H80000001&
BorderStyle = 3 'Fixed Dialog
Caption = "进货管理"
ClientHeight = 5040
ClientLeft = 45
ClientTop = 330
ClientWidth = 6525
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5040
ScaleWidth = 6525
ShowInTaskbar = 0 'False
Begin VB.CommandButton Cmd_Exit
Caption = "返回"
Height = 375
Left = 4320
TabIndex = 20
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmd_Update
Caption = "修改记录"
Height = 375
Left = 3120
TabIndex = 19
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmd_Del
Caption = "删除记录"
Height = 375
Left = 1920
TabIndex = 18
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmd_Addnew
Caption = "填进货单"
Height = 375
Left = 720
TabIndex = 17
Top = 2880
Width = 1215
End
Begin VB.Frame Frame3
BackColor = &H80000001&
Caption = "进货单查询"
Height = 1335
Left = 240
TabIndex = 11
Top = 3360
Width = 5895
Begin VB.CommandButton Cmd_Search
Caption = "开始查询"
Height = 375
Left = 4200
TabIndex = 16
Top = 720
Width = 975
End
Begin VB.TextBox Text6
BeginProperty DataFormat
Type = 1
Format = "yyyy-M-d"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 270
Left = 1800
TabIndex = 15
Top = 840
Width = 1455
End
Begin VB.TextBox Text5
Height = 270
Left = 1800
TabIndex = 14
Top = 360
Width = 1455
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "进货日期:"
Height = 255
Left = 840
TabIndex = 13
Top = 840
Width = 1095
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 840
TabIndex = 12
Top = 360
Width = 975
End
End
Begin MSAdodcLib.Adodc AdoShop
Height = 270
Left = 2280
Top = 2520
Width = 1935
_ExtentX = 3413
_ExtentY = 476
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 0
BackColor = -2147483647
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Initial Catalog=xt;Data Source=xt"
OLEDBString = "Provider=SQLOLEDB.1;Password=624813;Persist Security Info=True;User ID=xt;Initial Catalog=xt;Data Source=xt"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "Shop_Info"
Caption = "进货单"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
BackColor = &H80000001&
Caption = "进货单"
Enabled = 0 'False
Height = 2175
Left = 240
TabIndex = 0
Top = 240
Width = 5895
Begin VB.TextBox Text4
Appearance = 0 'Flat
DataField = "Ghf"
DataSource = "AdoShop"
Height = 270
Left = 1320
TabIndex = 10
Top = 1560
Width = 4095
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
DataField = "S_Date"
DataSource = "AdoShop"
Height = 270
Left = 4080
TabIndex = 8
Top = 960
Width = 1335
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
DataField = "Num"
DataSource = "AdoShop"
Height = 270
Left = 1320
TabIndex = 6
Top = 960
Width = 1335
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
DataField = "S_Size"
DataSource = "AdoShop"
Height = 300
ItemData = "frmShop.frx":0000
Left = 4080
List = "frmShop.frx":000D
TabIndex = 4
Top = 360
Width = 1335
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
DataField = "ID"
DataSource = "AdoShop"
Height = 270
Left = 1320
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "供货公司:"
Height = 255
Left = 360
TabIndex = 9
Top = 1560
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "进货日期:"
Height = 255
Left = 3120
TabIndex = 7
Top = 960
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "数 量:"
Height = 255
Left = 360
TabIndex = 5
Top = 960
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "尺 码:"
Height = 255
Left = 3120
TabIndex = 3
Top = 360
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 360
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "frmShop"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Addnew_Click()
On Error Resume Next
Frame1.Enabled = True
Cmd_Del.Enabled = False
Cmd_Update.Enabled = False
Cmd_Search.Enabled = False
If Cmd_Addnew.Caption = "填进货单" Then
Cmd_Addnew.Caption = "保存"
AdoShop.Recordset.MoveLast
AdoShop.Recordset.AddNew
Text1.SetFocus
Else
Cmd_Addnew.Caption = "填进货单"
AdoShop.Recordset.Update
AdoShop.Refresh
AdoShop.Recordset.MoveLast
Frame1.Enabled = False
Cmd_Del.Enabled = True
Cmd_Update.Enabled = True
Cmd_Search.Enabled = True
frmStor.AdoStor.Refresh
End If
End Sub
Private Sub Cmd_Del_Click()
On Error Resume Next
I = MsgBox("如果现在删除这张进货单,以后将无法恢复,你确定要删除吗?", vbOKCancel + vbQuestion, "请注意!")
If I = 1 Then
AdoShop.Recordset.Delete
AdoShop.Refresh
AdoShop.Recordset.MoveNext
If AdoShop.Recordset.EOF Then
AdoShop.Recordset.MoveLast
End If
End If
End Sub
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Cmd_Search_Click()
AdoShop.Recordset.MoveFirst
Cmd_Search.Enabled = False
Dim ID, S_Date As String
ID = Trim(Text5.Text)
S_Date = Trim(Text6.Text)
If ID = "" And S_Date = "" Then
MsgBox "你没有输入任何查询条件", vbOKOnly + vbCritical, "错误"
ElseIf ID = "" Then
AdoShop.Recordset.Find " S_Date='" & S_Date & "'"
ElseIf S_Date = "" Then
AdoShop.Recordset.Find " ID='" & ID & "'"
Else
AdoShop.Recordset.Find " ID='" & ID & "' OR S_Date='" & S_Date & "'"
End If
If AdoShop.Recordset.EOF Then
MsgBox "没有找到此记录"
AdoShop.Recordset.MoveFirst
End If
Text5.Text = ""
Text6.Text = ""
Cmd_Search.Enabled = True
End Sub
Private Sub Cmd_Update_Click()
On Error Resume Next
Frame1.Enabled = True
Cmd_Del.Enabled = False
Cmd_Addnew.Enabled = False
Cmd_Search.Enabled = False
If Cmd_Update.Caption = "修改记录" Then
Cmd_Update.Caption = "保存"
AdoShop.Recordset.Update
Text1.SetFocus
Else
Cmd_Update.Caption = "修改记录"
AdoShop.Recordset.Update
AdoShop.Refresh
Frame1.Enabled = False
Cmd_Del.Enabled = True
Cmd_Addnew.Enabled = True
Cmd_Search.Enabled = True
End If
End Sub
Private Sub Form_Load()
If Limit = "5" Then
Me.Cmd_Addnew.Enabled = False
Me.Cmd_Del.Enabled = False
Me.Cmd_Update.Enabled = False
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Cmd_Addnew.Caption = "保存" Or Cmd_Update.Caption = "保存" Then
I = MsgBox("数据没有存盘,要存盘吗?", vbOKCancel + vbQuestion, "请注意!")
End If
If I = 1 Then
AdoShop.Recordset.Update
Unload Me
Else
Unload Me
End If
End Sub
Private Sub Text3_GotFocus()
If Cmd_Addnew.Caption = "保存" Then
Text3.Text = Date
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -