📄 frmsell.frm
字号:
Width = 1530
End
Begin VB.Label Label3
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "合同编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 240
Left = 8400
TabIndex = 12
Top = 990
Width = 1275
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "数量合计:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 240
TabIndex = 11
Top = 7680
Width = 1275
End
Begin VB.Label lblSL
AutoSize = -1 'True
Caption = "Label6"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 1560
TabIndex = 10
Top = 7680
Width = 810
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "合计金额:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 3600
TabIndex = 9
Top = 7680
Width = 1275
End
Begin VB.Label lblJE
AutoSize = -1 'True
Caption = "Label7"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 4920
TabIndex = 8
Top = 7680
Width = 810
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "合计税额:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 6600
TabIndex = 7
Top = 7680
Width = 1275
End
Begin VB.Label lblSE
AutoSize = -1 'True
Caption = "Label8"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 7920
TabIndex = 6
Top = 7680
Width = 810
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "金税合计:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 9360
TabIndex = 5
Top = 7680
Width = 1275
End
Begin VB.Label lblJSHJ
AutoSize = -1 'True
Caption = "Label9"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 10680
TabIndex = 4
Top = 7680
Width = 810
End
Begin VB.Line Line1
X1 = 120
X2 = 11880
Y1 = 7560
Y2 = 7560
End
Begin VB.Line Line2
X1 = 120
X2 = 11880
Y1 = 8040
Y2 = 8040
End
Begin VB.Line Line3
X1 = 120
X2 = 120
Y1 = 7560
Y2 = 8040
End
Begin VB.Line Line4
X1 = 11880
X2 = 11880
Y1 = 7560
Y2 = 8040
End
End
Attribute VB_Name = "FrmSELL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Number As Integer
Dim gRow As Integer
Dim gCol As Integer
Dim KPRQ, Msgtext As String
Dim ButtonFlag As Integer
Dim XSDExcel As Excel.Application
Private Sub Form_Load()
Dim Rst, mrcc As ADODB.Recordset
Dim SQL As String
DTPicker1.Value = Date$
DTPicker2.Value = Date$
Text1.Visible = False
Set IDlist = New Collection
Call ReSet
txtNo = GetRkno()
Combo1.Clear
txtsql = "select DISTINCT cn_CompanyName from customers"
Set mrcc = ExecuteSQL(txtsql, Msgtext)
If Not mrcc.EOF Then
Do While Not mrcc.EOF
Combo1.AddItem Trim(mrcc.Fields(0))
mrcc.MoveNext
Loop
Else
MsgBox "请先进行公司信息设置!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
mrcc.Close
End Sub
Sub FPHM()
txtNo = GetRkno()
' Set Rst = New ADODB.Recordset
' SQL = "select max(fphm) from XSD_ZB where fphm like '" & Format(KPRQ, "yymmdd") & "%'"
' Rst.CursorLocation = adUseClient
' Rst.Open SQL, db, adOpenDynamic, adLockReadOnly, adCmdText
'
' If IsNull(Rst.Fields(0)) Then
' Number = 1
' Else
' Number = Val(Mid(Rst.Fields(0), 8)) + 1
' End If
' Rst.Close
' Set Rst = Nothing
'LblFPHM.Caption = Format(KPRQ, "yymmdd") & Format(CStr(Number), "000")
End Sub
Private Sub ReSet()
Grid.Clear
Grid.Rows = 1
Grid.FormatString = "序号|^ 商 品 名 称 |^ 货 号 |^ 规 格 |^ 材 料 |^ 数 量 |^ 单 价 |^ 金 额 |^ 税 率 |^ 税 额 |^ 金 税 合 计| SPID"
Grid.ColWidth(11) = 0
' TxtSHR.Caption = ""
lblSL.Caption = "0"
lblJE.Caption = "0.00"
lblSE.Caption = "0.00"
lblJSHJ.Caption = "0.00"
Set IDlist = New Collection
Grid.Enabled = True
End Sub
Private Sub Grid_DblClick()
If Grid.Rows = 1 Then Exit Sub
Text1.Top = Grid.CellTop + Grid.Top
Text1.Left = Grid.CellLeft + Grid.Left
gRow = Grid.Row
gCol = Grid.Col
If gCol <> 5 And gCol <> 6 And gCol <> 8 Then Exit Sub
Text1.Width = Grid.CellWidth '- 2 * Screen.TwipsPerPixelX
Text1.Height = Grid.CellHeight ' - 2 * Screen.TwipsPerPixelY
Text1.Text = Grid.Text
' Show the text box:
Text1.Visible = True
Text1.ZOrder 0 ' 把 Text1 放到最前面!
Text1.SetFocus
' Redirect this KeyPress event to the text box:
If KeyAscii <> 13 Then
SendKeys Chr$(KeyAscii)
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
Text1.BackColor = &HFFFF&
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Grid.SetFocus ' Set focus back to grid, see Text_LostFocus.
KeyAscii = 0 ' Ignore this KeyPress.
End If
If KeyAscii <> 8 And KeyAscii <> 45 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then
' 'Beep
KeyAscii = 0
End If
End Sub
Private Sub Grid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Grid_DblClick
End If
End Sub
Private Sub Grid_KeyUp(KeyCode As Integer, Shift As Integer)
Dim Rst As ADODB.Recordset
Dim Cmd As ADODB.Command
Dim SQL As String
Dim I As Integer
Dim N As Integer
Dim JZF As Integer
Select Case KeyCode
' Case vbKeyF1
' Call Command2_Click
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -