📄 frmjhd.frm
字号:
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "选择商品"
ForeColor = &H00800000&
Height = 615
Index = 5
Left = 480
TabIndex = 12
Top = 480
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单 位:"
ForeColor = &H00800000&
Height = 180
Index = 6
Left = 3840
TabIndex = 11
Top = 600
Width = 630
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "开票人:"
ForeColor = &H00800000&
Height = 180
Index = 7
Left = 6720
TabIndex = 10
Top = 600
Width = 720
End
End
Begin VB.Frame Frame1
BackColor = &H00FF8080&
Caption = "供应商信息"
Height = 975
Left = 120
TabIndex = 3
Top = 1200
Width = 9855
Begin VB.ComboBox Combo5
DataField = "供货商"
DataSource = "Adodc1"
Height = 300
Left = 1080
TabIndex = 27
Text = "Combo5"
Top = 360
Width = 2775
End
Begin VB.TextBox Text5
DataField = "押金"
DataSource = "Adodc1"
Height = 375
Left = 5160
TabIndex = 26
Text = "Text5"
Top = 360
Width = 975
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "押 金:"
Height = 255
Left = 4320
TabIndex = 25
Top = 480
Width = 855
End
Begin VB.Label label2
BackStyle = 0 'Transparent
Caption = "Label2"
DataField = "应付款"
DataSource = "Adodc1"
Height = 495
Index = 1
Left = 7800
TabIndex = 6
Top = 480
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "应付款:"
Height = 375
Index = 4
Left = 6720
TabIndex = 5
Top = 480
Width = 735
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "供应商:"
Height = 375
Index = 2
Left = 240
TabIndex = 4
Top = 360
Width = 1095
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 615
Left = 0
TabIndex = 0
Top = 0
Width = 10020
_ExtentX = 17674
_ExtentY = 1085
ButtonWidth = 1773
ButtonHeight = 926
Appearance = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 添 加 "
Key = "TJ"
Object.ToolTipText = "添加进货单"
BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
NumButtonMenus = 1
BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保 存"
Key = "BC"
Object.ToolTipText = "保存当前进货单"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "sc"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退 出"
Key = "tc"
EndProperty
EndProperty
BorderStyle = 1
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "Label3"
DataField = "单据编号"
DataSource = "Adodc1"
Height = 495
Left = 1320
TabIndex = 20
Top = 840
Width = 1935
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "进货日期:"
Height = 375
Index = 1
Left = 6000
TabIndex = 2
Top = 840
Width = 1215
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单据编号:"
Height = 375
Index = 0
Left = 360
TabIndex = 1
Top = 840
Width = 1095
End
End
Attribute VB_Name = "FRMJHD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim msgtext1 As String
Dim txtsql1 As String
Dim mrc1 As ADODB.Recordset
Dim txtsql2 As String
Dim msgtext2 As String
Dim mrc2 As ADODB.Recordset
Dim msgtext3 As String
Dim txtsql3 As String
Dim mrc3 As ADODB.Recordset
txtsql1 = "select distinct 供应商名称 from proviter"
Set mrc1 = ExecuteSQL(txtsql1, msgtext1)
If mrc1.EOF = False Then
Do While Not mrc1.EOF
Combo5.AddItem Trim(mrc1.Fields(0))
mrc1.MoveNext
Loop
Combo5.ListIndex = 0
End If
mrc1.Close
txtsql2 = "select distinct 商品名称 from goods"
Set mrc2 = ExecuteSQL(txtsql2, msgtext2)
If mrc2.EOF = False Then
Do While Not mrc2.EOF
Combo1.AddItem Trim(mrc2.Fields(0))
mrc2.MoveNext
Loop
Combo1.ListIndex = 0
End If
mrc2.Close
Combo4.AddItem Trim("个")
txtsql3 = "select distinct 姓名 from workers "
Set mrc3 = ExecuteSQL(txtsql3, msgtext3)
If mrc3.EOF = False Then
Do While Not mrc3.EOF
Combo2.AddItem Trim(mrc3.Fields(0))
mrc3.MoveNext
Loop
Combo2.ListIndex = 0
End If
mrc3.Close
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
Combo3.Text = Date
On Error Resume Next
Adodc1.Recordset.AddNew
Adodc1.Recordset("单据编号") = Format(Date, "yy") & Format(Date, "mm") & Format(Date, "dd") & Int(Timer)
Adodc1.Recordset("供货商") = ""
Adodc1.Recordset("商品名称") = ""
Adodc1.Recordset("押金") = ""
Adodc1.Recordset("单位") = ""
Adodc1.Recordset("备注") = ""
Adodc1.Recordset("数量") = Val(Text2.Text)
Adodc1.Recordset("金额") = ""
Adodc1.Recordset("进货时间") = Format(Date, "yy-mm-dd")
Adodc1.Recordset("总金额") = Val(Text2.Text) * Val(Text3.Text)
Adodc1.Recordset("开票人") = ""
Adodc1.Recordset("应付款") = Val(Text2.Text) * Val(Text3.Text) - Val(Text5.Text)
Adodc1.Recordset.MoveLast
Case 3
If Not (Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF) Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End If
Case 2
msglist.Refresh
Case 4
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -