📄 frmth.frm
字号:
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 840
TabIndex = 27
Top = 3000
Width = 1575
End
Begin VB.Label Label9
Caption = "总 金 额:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 5760
TabIndex = 26
Top = 3000
Width = 1695
End
Begin VB.Label Label7
Caption = "备 注:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 840
TabIndex = 25
Top = 3600
Width = 1455
End
Begin VB.Label Label5
Caption = "单 价:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 5760
TabIndex = 24
Top = 2400
Width = 1695
End
Begin VB.Label Label3
Caption = "产品编号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 615
Left = 5760
TabIndex = 23
Top = 1800
Width = 1455
End
Begin VB.Label Label2
Caption = "单 位:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 840
TabIndex = 22
Top = 2400
Width = 1455
End
Begin VB.Label Label1
Caption = "退货单编号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 840
TabIndex = 21
Top = 1080
Width = 1695
End
Begin VB.Label Label12
Caption = "客户编号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 5760
TabIndex = 20
Top = 1080
Width = 1455
End
Begin VB.Label Label13
Caption = "客户名称:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 840
TabIndex = 19
Top = 1800
Width = 1455
End
Begin VB.Label Label6
Caption = "发货单编号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 5760
TabIndex = 18
Top = 480
Width = 1815
End
End
Begin VB.TextBox txtczy
Appearance = 0 'Flat
BackColor = &H8000000B&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 9720
TabIndex = 15
Top = 8160
Width = 1695
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 3480
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 8160
Width = 1935
End
Begin VB.Label Label8
Caption = "操 作 员:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 8280
TabIndex = 29
Top = 8160
Width = 1575
End
End
Attribute VB_Name = "frmth"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
txtth.Enabled = True
txtth.Locked = True
txtcp.Enabled = True
txtdw.Enabled = True
txtfh.Enabled = True
txtdw.Text = "箱"
txtdj.Enabled = True
txtdj.Text = 0
txtquan.Enabled = True
txtname.Enabled = True
txtquan.Text = 0
txtzje.Enabled = True
txtzje.Locked = True
txtbz.Enabled = True
txtkh.Enabled = True
txtdate.Enabled = True
txtdate.Locked = True
Command1.Enabled = False
Command2.Enabled = True
txtfh.SetFocus
txtdate.Text = Year(Now) & "-" & Month(Now) & "-" & Day(Now)
Dim db As Database
Dim wk As Workspace
Set wk = DBEngine.Workspaces(0)
Dim rs1 As Recordset
Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
wk.BeginTrans
Set rs1 = db.OpenRecordset("temp", dbOpenDynaset, dbwrite, dbOptimistic)
rs1.MoveFirst
Do While rs1.EOF <> True
rs1.Delete
rs1.MoveNext
If rs1.EOF = True Then
Exit Do
End If
Loop
wk.CommitTrans
Data1.Connect = access
Data1.DefaultType = 1
Data1.DatabaseName = "xsys"
DBGrid1.Refresh
db.Close
End Sub
Private Sub Command2_Click()
On Error GoTo a
DefaultType = dbUseODBC
Dim db As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Dim cx As Boolean
cx = False
Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
Set rs1 = db.OpenRecordset("xhk", dbOpenDynaset, dbwrite, dbOptimistic)
If txtth.Text = "" Or txtcp.Text = "" Or txtname.Text = "" Then
If MsgBox("编号不能为空,请重新输入!", vbOKCancel, "错误") = vbOK Then
Command3.SetFocus
Else
Command3.SetFocus
End If
Else
rs1.MoveFirst
Do While rs1.EOF <> True
If rs1.Fields("产品编号") = LTrim(txtcp.Text) Then
cx = True
Exit Do
Else
rs1.MoveNext
End If
Loop
If MsgBox("请确认填写无误,否则修改!", vbOKCancel, "提示") = vbOK Then
If cx = True Then
rs1.Edit
rs1.Fields("数量") = CLng(rs1.Fields("数量")) + CLng(LTrim(txtquan.Text))
rs1.Update
rs1.Close
Set rs2 = db.OpenRecordset("fdk2002", dbOpenDynaset, dbwrite, dbOptimistic)
With rs2
.AddNew
.Fields("发货单编号") = LTrim(txtth.Text)
.Fields("产品编号") = LTrim(txtcp.Text)
.Fields("单位") = LTrim(txtdw.Text)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -