📄 frmthd.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "Msadodc.OCX"
Begin VB.Form FRMTHD
Caption = "退货单"
ClientHeight = 5160
ClientLeft = 60
ClientTop = 345
ClientWidth = 7005
LinkTopic = "Form1"
Picture = "FRMTHD.frx":0000
ScaleHeight = 5160
ScaleWidth = 7005
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3000
Top = 5280
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_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 = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBString = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from thd"
Caption = "Adodc1"
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.ComboBox Combo2
DataField = "进货单据编号"
DataSource = "Adodc1"
Height = 300
Left = 3360
TabIndex = 7
Text = "Combo2"
Top = 840
Width = 1215
End
Begin VB.ComboBox Combo1
DataField = "退货日期"
DataSource = "Adodc1"
Height = 300
Left = 5760
TabIndex = 5
Text = "Combo1"
Top = 840
Width = 1215
End
Begin VB.Frame Frame1
Caption = "退货信息"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 3375
Left = 120
TabIndex = 1
Top = 1440
Width = 6855
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FRMTHD.frx":3245
Height = 2895
Left = 240
TabIndex = 8
Top = 360
Width = 6375
_ExtentX = 11245
_ExtentY = 5106
_Version = 393216
BackColor = 16744576
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 615
Left = 0
TabIndex = 0
Top = 0
Width = 7005
_ExtentX = 12356
_ExtentY = 1085
ButtonWidth = 1773
ButtonHeight = 926
Appearance = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退货"
Key = "BC"
Object.ToolTipText = "保存商品"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "取消"
Key = "QX"
Object.ToolTipText = "取消"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 退出 "
Key = "TC"
EndProperty
EndProperty
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "选择进货单"
Height = 180
Left = 2280
TabIndex = 6
Top = 840
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "退货日期"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4800
TabIndex = 4
Top = 840
Width = 840
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Label2"
DataField = "单据编号"
DataSource = "Adodc1"
Height = 375
Left = 1080
TabIndex = 3
Top = 840
Width = 1095
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单据编号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 120
TabIndex = 2
Top = 840
Width = 840
End
End
Attribute VB_Name = "FRMTHD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim txtsql As String
Dim msgtext As String
Dim mrc As ADODB.Recordset
Private Sub Form_Load()
Dim msgtext1 As String
Dim txtsql1 As String
Dim mrc1 As ADODB.Recordset
txtsql1 = "select 单据编号 from jhd"
Set mrc1 = ExecuteSQL(txtsql1, msgtext1)
If mrc1.EOF = False Then
Do While Not mrc1.EOF
Combo2.AddItem Trim(mrc1.Fields(0))
mrc1.MoveNext
Loop
Combo2.ListIndex = 0
mrc1.Close
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
Combo1.Text = Date
txtsql = "select * from jhd where 单据编号= '" & Combo2.Text & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
On Error Resume Next
Adodc1.Recordset.AddNew
Adodc1.Recordset("进货单据编号") = mrc.Fields(0)
Adodc1.Recordset("进货日期") = mrc.Fields(1)
Adodc1.Recordset("单价") = mrc.Fields(8)
Adodc1.Recordset("单据编号") = Format(Date, "yy") & Format(Date, "mm") & Format(Date, "dd") & Int(Timer)
Adodc1.Recordset("退货日期") = Format(Date, "yy-mm-dd")
Adodc1.Recordset("供货商名称") = mrc.Fields(2)
Adodc1.Recordset("商品名称") = mrc.Fields(5)
Adodc1.Recordset("单位") = mrc.Fields(6)
Adodc1.Recordset("数量") = mrc.Fields(7)
Adodc1.Recordset("总计金额") = mrc.Fields(9)
Adodc1.Recordset("备注") = mrc.Fields(10)
Adodc1.Recordset("开票人") = mrc.Fields(11)
Adodc1.Recordset.MoveLast
Case 2
If Not (Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF) Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End If
Case 3
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -