📄 frmdd.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmDD
BorderStyle = 3 'Fixed Dialog
Caption = "订单录入"
ClientHeight = 4440
ClientLeft = 45
ClientTop = 435
ClientWidth = 9720
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4440
ScaleWidth = 9720
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc AdoCustor
Height = 330
Left = 360
Top = 4320
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 MSAdodcLib.Adodc AdoDD
Height = 330
Left = 480
Top = 3840
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.CommandButton CmdCancle
Caption = "取消"
Height = 495
Left = 8160
TabIndex = 16
Top = 3840
Width = 1335
End
Begin VB.CommandButton CmdSave
Caption = "保存"
Height = 495
Left = 6600
TabIndex = 15
Top = 3840
Width = 1215
End
Begin VB.Frame Frame1
Caption = "订单明细"
Height = 2775
Left = 360
TabIndex = 1
Top = 720
Width = 9135
Begin VB.TextBox Text2
Height = 375
Left = 1440
TabIndex = 19
Top = 1845
Width = 495
End
Begin VB.ComboBox Combo1
Height = 300
Left = 7200
TabIndex = 17
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Index = 5
Left = 4440
TabIndex = 8
Top = 1845
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 4
Left = 7200
TabIndex = 7
Top = 1320
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 3
Left = 4440
TabIndex = 6
Top = 1320
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1440
TabIndex = 5
Top = 1320
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 4440
TabIndex = 4
Top = 720
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1440
TabIndex = 3
Top = 720
Width = 1455
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "%"
BeginProperty Font
Name = "Times New Roman"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 2040
TabIndex = 20
Top = 1920
Width = 270
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "货款已到:"
Height = 180
Left = 420
TabIndex = 18
Top = 1920
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "订货客户:"
Height = 180
Left = 6360
TabIndex = 14
Top = 1920
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "订货日期:"
Height = 180
Left = 3480
TabIndex = 13
Top = 1920
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "金额:"
Height = 180
Left = 6480
TabIndex = 12
Top = 1440
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "数量:"
Height = 180
Left = 3840
TabIndex = 11
Top = 1440
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "批号:"
Height = 180
Left = 780
TabIndex = 10
Top = 1440
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "商品名称:"
Height = 180
Left = 3480
TabIndex = 9
Top = 840
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "订单号:"
Height = 180
Left = 600
TabIndex = 2
Top = 840
Width = 720
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "订单录入"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4200
TabIndex = 0
Top = 240
Width = 1260
End
End
Attribute VB_Name = "FrmDD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdCancle_Click()
Unload Me
End Sub
Private Sub CmdSave_Click()
Dim M As Double
M = Val(Val(Trim(Text2)))
SQL = "select * from ddxx where 订单号='" & Text1(0) & "'"
AdoDD.RecordSource = SQL
AdoDD.Refresh
If AdoDD.Recordset.RecordCount = 0 Then
For i = 0 To 5
If Text1(i) = "" Then
MsgBox "请完整输入信息", vbCritical + vbOKOnly, "提示"
Exit Sub
End If
Next i
AdoDD.Recordset.AddNew
For i = 0 To 5
AdoDD.Recordset(i) = Text1(i)
Next
AdoDD.Recordset(6) = Combo1.Text
AdoDD.Recordset(7) = M / 100
AdoDD.Recordset.Update
AdoDD.Refresh
aa = MsgBox("保存成功,是否继续录入?", vbQuestion + vbYesNo, "提示")
If aa = vbYes Then
For i = 0 To 5
Text1(i) = ""
Next i
Text1(5) = Date
Text2 = ""
Else
Unload Me
End If
Else
MsgBox "存在此订单号,请重新输入!!", vbCritical + vbOKOnly, "提示"
Text1(0).SetFocus
End If
End Sub
Private Sub Form_Load()
DataPath = App.Path + "\DB.mdb" '数据库所在路径
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataPath & ";Persist Security Info=False"
AdoDD.ConnectionString = conn
AdoDD.RecordSource = "select * from ddxx"
AdoDD.Refresh
AdoCustor.ConnectionString = conn
AdoCustor.RecordSource = "select * from qyjbxx"
AdoCustor.Refresh
flag = AdoCustor.Recordset.RecordCount
If flag <> 0 Then
For i = 0 To flag - 1
Combo1.AddItem (AdoCustor.Recordset(1))
AdoCustor.Recordset.MoveNext
Next i
End If
Text1(5) = Date
End Sub
Private Sub Text2_Change()
If Val(Trim(Text2)) > 100 Then
MsgBox "输入有误,不可超过100%!", vbCritical + vbOKOnly, "警告"
Text2 = ""
Text2.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -