📄 frmout.frm
字号:
Left = 1080
TabIndex = 30
Top = 2280
Width = 1455
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 = 495
Left = 1080
TabIndex = 29
Top = 1680
Width = 1695
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 = 5520
TabIndex = 28
Top = 2280
Width = 1695
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 = 5520
TabIndex = 27
Top = 3480
Width = 1455
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 = 1080
TabIndex = 26
Top = 4080
Width = 1455
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 = 5520
TabIndex = 25
Top = 2880
Width = 1695
End
Begin VB.Label Label10
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 = 1080
TabIndex = 24
Top = 3480
Width = 1695
End
Begin VB.Label Label11
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 = 1080
TabIndex = 23
Top = 2880
Width = 1575
End
Begin VB.Label Label4
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 = 1080
TabIndex = 22
Top = 480
Width = 1455
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 = 5520
TabIndex = 21
Top = 480
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 = 5520
TabIndex = 20
Top = 1080
Width = 1455
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 = 9480
TabIndex = 17
Top = 8040
Width = 1695
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 3360
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 8160
Visible = 0 'False
Width = 1935
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 720
Top = 8040
_ExtentX = 847
_ExtentY = 847
_Version = 393216
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 = 8040
TabIndex = 33
Top = 8040
Width = 1575
End
End
Attribute VB_Name = "frmout"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
DefaultType = dbUseODBC
txtfh.Enabled = True
txtfh.Locked = True
txtcp.Enabled = True
txtdw.Enabled = True
txtgg.Enabled = True
txtgg.Locked = True
txtdw.Text = "箱"
txtdw.Locked = True
txtdj.Enabled = True
commok.Enabled = True
'txtdj.Text = 0
txtsl.Enabled = True
'txtsl.Text = 0
txtzje.Enabled = True
'txtzje.Text = 0
txtzje.Locked = True
txtysr.Enabled = True
txtch.Enabled = True
txtname.Enabled = True
txtname.Locked = True
txtbz.Enabled = True
txtkh.Enabled = True
txtdate.Enabled = True
Command1.Enabled = False
txtkh.SetFocus
txtdate.Text = Year(Now) & "-" & Month(Now) & "-" & Day(Now)
txtdate.Locked = True
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()
DefaultType = dbUseODBC
Dim db As Database
Dim sql As String
Dim str As String
Dim i As Integer
Dim wk As Workspace
Set wk = DBEngine.Workspaces(0)
Dim rs1 As Recordset
Dim rs2 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)
Set rs2 = db.OpenRecordset("xhk", dbOpenDynaset, dbwrite, dbOptimistic)
rs1.MoveFirst
Do While rs1.EOF <> True
rs2.MoveFirst
Do While rs2.EOF <> True
If rs2.Fields("产品编号") = rs1.Fields("产品编号") Then
rs2.Edit
rs2.Fields("数量") = rs2.Fields("数量") - rs1.Fields("数量")
rs2.Update
Exit Do
Else
rs2.MoveNext
End If
If rs2.EOF = True Then
Exit Do
End If
Loop
rs1.MoveNext
If rs1.EOF = True Then
Exit Do
End If
Loop
rs1.Close
rs2.Close
str = "fdk" & CStr(Year(Now))
sql = "insert into [" + str + "] select * from [temp]"
db.Execute sql
Data1.RecordSource = "select * from temp"
Data1.Refresh
sql = "select * from temp"
If MsgBox("发货已成功,是否打印发货单?", vbYesNo, "打印") = vbYes Then
CommonDialog1.ShowPrinter
Printer.Orientation = vbPRORPortrait
Printer.PaperSize = vbPRPSA4
Printer.ScaleMode = vbMillimeters
Printer.FontName = "宋体"
Printer.FontSize = 18
sql = "select * from temp"
Set rs1 = db.OpenRecordset(sql, dbOpenDynaset, dbwrite, dbOptimistic)
Printer.CurrentX = 60
Printer.CurrentY = 15
Printer.Print "扬州市兴盛牙刷厂发货单"
Printer.Line (50, 22)-(140, 22)
Printer.Line (50, 23)-(140, 23)
rs1.MoveFirst
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -