📄 dhd.frm
字号:
Height = 375
Left = 4440
TabIndex = 11
Text = "Text9"
Top = 840
Width = 1695
End
Begin VB.TextBox Text7
DataField = "备注"
DataSource = "Adodc1"
Height = 375
Left = 1200
ScrollBars = 2 'Vertical
TabIndex = 9
Text = "Text7"
Top = 3360
Width = 7695
End
Begin VB.TextBox Text3
DataField = "客户地址"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 4
Top = 1440
Width = 4455
End
Begin VB.Label Label15
BackStyle = 0 'Transparent
Caption = "单位:"
Height = 375
Left = 3120
TabIndex = 22
Top = 2040
Width = 975
End
Begin VB.Label Label14
BackStyle = 0 'Transparent
Caption = "单价:"
Height = 495
Left = 360
TabIndex = 20
Top = 2760
Width = 855
End
Begin VB.Label Label13
BackStyle = 0 'Transparent
Caption = "数量:"
Height = 375
Left = 5760
TabIndex = 18
Top = 2040
Width = 1095
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "商品名称:"
Height = 495
Left = 240
TabIndex = 16
Top = 2040
Width = 975
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "备用电话:"
Height = 375
Left = 6720
TabIndex = 14
Top = 840
Width = 1215
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "Label5"
DataField = "总计金额"
DataSource = "Adodc1"
Height = 375
Left = 4200
TabIndex = 13
Top = 2880
Width = 1095
End
Begin VB.Label Label19
BackStyle = 0 'Transparent
Caption = "合计金额:"
Height = 375
Left = 3000
TabIndex = 10
Top = 2880
Width = 1095
End
Begin VB.Label Label17
BackStyle = 0 'Transparent
Caption = "备注:"
Height = 375
Left = 360
TabIndex = 8
Top = 3360
Width = 735
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "电话:"
Height = 375
Left = 3600
TabIndex = 7
Top = 840
Width = 735
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "送水地址:"
Height = 375
Left = 240
TabIndex = 6
Top = 1440
Width = 1095
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "hhh"
DataField = "单据号"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 5
Top = 360
Width = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "客 户:"
Height = 375
Left = 240
TabIndex = 3
Top = 840
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "订货时间:"
Height = 255
Left = 3480
TabIndex = 2
Top = 360
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单 据 号:"
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "DHD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo2_LostFocus()
Dim txtsql As String
Dim msgtext As String
Dim mrc As ADODB.Recordset
txtsql = "select 电话,备用电话,地址 from users where 姓名= '" & Combo2.Text & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
Text9.Text = mrc.Fields(0)
Text1.Text = mrc.Fields(1)
Text3.Text = mrc.Fields(2)
mrc.Close
End Sub
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
txtsql1 = "select 姓名 from users"
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
End If
mrc1.Close
txtsql2 = "select distinct 水票名称 from waters"
Set mrc2 = ExecuteSQL(txtsql2, msgtext2)
If mrc2.EOF = False Then
Do While Not mrc2.EOF
Combo3.AddItem Trim(mrc2.Fields(0))
mrc2.MoveNext
Loop
Combo3.ListIndex = 0
End If
Combo4.AddItem Trim("桶")
mrc2.Close
End Sub
Private Sub text4_lostfocus()
If Not IsNumeric(Text4.Text) Then
MsgBox "请输入数字!!", vbExclamation + vbOKOnly, 提示
Text4.SetFocus
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
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("订货时间") = Format(Date, "yy-mm-dd")
Adodc1.Recordset("商品名称") = ""
Adodc1.Recordset("单位") = ""
Adodc1.Recordset("数量") = Val(Text4.Text)
Adodc1.Recordset("单价") = ""
Adodc1.Recordset("总计金额") = Val(Text5.Text) * Val(Text4.Text)
Adodc1.Recordset("备注") = ""
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
DataGrid1.Refresh
Case 4
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -