📄 frmorder.frm
字号:
ItemData = "frmOrder.frx":0017
Left = 1560
List = "frmOrder.frx":0024
TabIndex = 9
Top = 1560
Width = 1095
End
Begin VB.TextBox Text8
Appearance = 0 'Flat
DataField = "Stor_ID"
DataSource = "AdoOrder"
Height = 270
Left = 9000
TabIndex = 8
Top = 960
Width = 1095
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
DataField = "Finish"
DataSource = "AdoOrder"
Height = 300
ItemData = "frmOrder.frx":0034
Left = 6480
List = "frmOrder.frx":003E
TabIndex = 7
Top = 960
Width = 1095
End
Begin VB.TextBox Text7
Appearance = 0 'Flat
DataField = "Diff"
DataSource = "AdoOrder"
Height = 270
Left = 9000
TabIndex = 12
Top = 1560
Width = 1095
End
Begin VB.TextBox Text6
Appearance = 0 'Flat
DataField = "Should_M"
DataSource = "AdoOrder"
Height = 270
Left = 3960
TabIndex = 6
Top = 960
Width = 1095
End
Begin VB.TextBox Text5
Appearance = 0 'Flat
DataField = "Post_Price"
DataSource = "AdoOrder"
Height = 270
Left = 1560
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.TextBox Text4
Appearance = 0 'Flat
DataField = "Order_M"
DataSource = "AdoOrder"
Height = 270
Left = 9000
TabIndex = 4
Top = 360
Width = 1095
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
DataField = "O_Date"
DataSource = "AdoOrder"
Height = 270
Left = 6480
TabIndex = 3
Top = 360
Width = 1095
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
CausesValidation= 0 'False
DataField = "Cust_Name"
DataSource = "AdoOrder"
Height = 270
Left = 3960
TabIndex = 2
Top = 360
Width = 1095
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
DataField = "ID"
DataSource = "AdoOrder"
Height = 270
Left = 1560
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "商品价格:"
Height = 255
Left = 5520
TabIndex = 27
Top = 1560
Width = 975
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "商品数量:"
Height = 255
Left = 3000
TabIndex = 26
Top = 1560
Width = 975
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "商品尺码:"
Height = 255
Left = 600
TabIndex = 25
Top = 1560
Width = 1095
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "商品编号:"
Height = 255
Left = 8040
TabIndex = 24
Top = 960
Width = 975
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "收单完成:"
Height = 255
Left = 5520
TabIndex = 23
Top = 960
Width = 975
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "差 额:"
Height = 255
Left = 8040
TabIndex = 22
Top = 1560
Width = 975
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "应收金额:"
Height = 255
Left = 3000
TabIndex = 21
Top = 960
Width = 975
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "收到邮费:"
Height = 255
Left = 600
TabIndex = 20
Top = 960
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "收到金额:"
Height = 255
Left = 8040
TabIndex = 19
Top = 360
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "收单时间:"
Height = 255
Left = 5520
TabIndex = 18
Top = 360
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "顾客姓名:"
Height = 255
Left = 3000
TabIndex = 17
Top = 360
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "订单编号:"
Height = 255
Left = 600
TabIndex = 16
Top = 360
Width = 975
End
End
Begin MSAdodcLib.Adodc AdoOrder
Height = 285
Left = 4800
Top = 2520
Width = 2055
_ExtentX = 3625
_ExtentY = 503
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 0
BackColor = -2147483647
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"frmOrder.frx":004A
OLEDBString = $"frmOrder.frx":00E8
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Order_Info,Order_M where Order_Info.ID=Order_M.Order_ID"
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
End
Attribute VB_Name = "frmOrder"
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_Save.Enabled = True
Cmd_Addnew.Enabled = False
Cmd_Del.Enabled = False
Cmd_Update.Enabled = False
Cmd_Search.Enabled = False
AdoOrder.Recordset.MoveLast
Dim T As Integer
T = AdoOrder.Recordset.Fields("ID")
AdoOrder.Recordset.AddNew
Text1.Text = T + 1
Text2.SetFocus
End Sub
Private Sub Cmd_Del_Click()
On Error Resume Next
I = MsgBox("如果现在删除这份订单,以后将无法恢复,你确定要删除吗?", vbOKCancel + vbQuestion, "请注意!")
If I = 1 Then
Text16.Text = Text1.Text
AdoOrder.Recordset.Delete
AdoOrder.Refresh
AdoOrder.Recordset.MoveNext
If AdoOrder.Recordset.EOF Then
AdoOrder.Recordset.MoveLast
End If
End If
End Sub
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Cmd_Search_Click()
If AdoOrder.Recordset.EOF = True Then
MsgBox "无任何记录可以查询"
Else
AdoOrder.Recordset.MoveFirst
Cmd_Search.Enabled = False
Dim ID As Integer
Dim CustName As String
ID = IIf(Trim(Text14.Text) = "", 0, Trim(Text14.Text))
CustName = Trim(Text15.Text)
If ID = 0 And CustName = "" Then
MsgBox "你没有输入任何查询条件", vbOKOnly + vbCritical, "错误"
ElseIf ID = 0 Then
AdoOrder.Recordset.Find " Cust_Name='" & CustName & "'"
ElseIf CustName = "" Then
AdoOrder.Recordset.Find " ID='" & ID & "'"
Else
AdoOrder.Recordset.Find " ID='" & ID & "' or Cust_Name='" & CustName & "'"
End If
If AdoOrder.Recordset.EOF Then
MsgBox "没有找到此顾客"
AdoOrder.Recordset.MoveFirst
End If
Text14.Text = ""
Text15.Text = ""
Cmd_Search.Enabled = True
End If
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
Cmd_Update.Enabled = False
Cmd_Save.Enabled = True
Text1.SetFocus
End Sub
Private Sub Form_Load()
Frame1.Enabled = False
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.Enabled = False Or Cmd_Update.Enabled = False Then
I = MsgBox("数据没有存盘,要存盘吗?", vbOKCancel + vbQuestion, "提示")
End If
If I = 1 Then
AdoOrder.Recordset.Update
Unload Me
Else
Unload Me
End If
End Sub
Private Sub Text3_GotFocus()
If Me.Cmd_Addnew.Enabled = False Then
Text3.Text = Date
End If
End Sub
Private Sub Text7_GotFocus()
If Text4.Text <> "" And Text10.Text <> "" Then
Text7.Text = Text4.Text - Text10.Text
End If
End Sub
Private Sub Cmd_Save_Click()
Text16.Text = Text1.Text
On Error Resume Next
AdoOrder.Recordset.Update
AdoOrder.Refresh
AdoOrder.Recordset.MoveLast
Frame1.Enabled = False
Cmd_Save.Enabled = False
Cmd_Addnew.Enabled = True
Cmd_Del.Enabled = True
Cmd_Update.Enabled = True
Cmd_Search.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -