📄 frmregjh.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmRegJH
BorderStyle = 3 'Fixed Dialog
Caption = "进货登记"
ClientHeight = 3885
ClientLeft = 45
ClientTop = 330
ClientWidth = 6000
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmRegJH.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3885
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtHh
Height = 300
Left = 2295
MaxLength = 25
TabIndex = 0
Top = 765
Width = 2985
End
Begin VB.ComboBox cmbSpdm
Height = 300
Left = 2295
TabIndex = 1
Top = 1125
Width = 2985
End
Begin VB.CommandButton cmdClear
Caption = "清空"
Height = 330
Left = 4140
TabIndex = 15
TabStop = 0 'False
Top = 2070
Width = 1140
End
Begin VB.CommandButton cmdAdd
Caption = "添加"
Enabled = 0 'False
Height = 330
Left = 4140
TabIndex = 6
Top = 2520
Width = 1140
End
Begin VB.TextBox txtJhsl
Height = 300
Left = 2295
MaxLength = 5
TabIndex = 4
Top = 2205
Width = 1410
End
Begin VB.TextBox txtJhjg
Height = 300
Left = 2295
MaxLength = 5
TabIndex = 3
Top = 1845
Width = 1410
End
Begin MSComCtl2.DTPicker dtpJhrq
Height = 300
Left = 2295
TabIndex = 5
Top = 2565
Width = 1455
_ExtentX = 2566
_ExtentY = 529
_Version = 393216
Format = 20185089
CurrentDate = 38111
End
Begin VB.ComboBox cmbSpmc
Height = 300
Left = 2295
TabIndex = 2
Top = 1485
Width = 2985
End
Begin VB.Frame Frame1
Height = 1320
Left = -45
TabIndex = 10
Top = 3015
Width = 6135
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 4590
TabIndex = 7
Top = 270
Width = 1230
End
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "货 号:"
Height = 180
Left = 1305
TabIndex = 17
Top = 810
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "商品代码:"
Height = 180
Left = 1305
TabIndex = 16
Top = 1215
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "进货日期:"
Height = 180
Left = 1305
TabIndex = 14
Top = 2655
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "进货数量:"
Height = 180
Left = 1305
TabIndex = 13
Top = 2295
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "进货价格:"
Height = 180
Left = 1305
TabIndex = 12
Top = 1935
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "商品名称:"
Height = 180
Left = 1305
TabIndex = 11
Top = 1575
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请填写进货商品的信息"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 240
Left = 180
TabIndex = 9
Top = 135
Width = 2550
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Height = 510
Left = 0
TabIndex = 8
Top = 0
Width = 6000
End
End
Attribute VB_Name = "frmRegJH"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim intSpKey As Integer 'spzd_key
Private Sub cmbSpdm_Click()
With rstMain
If .State = adStateOpen Then .Close
.Open "select * from spzd where spdm='" & cmbSpdm.Text & "'"
If Not .BOF Or Not .EOF Then
cmbSpmc.Text = !spmc & ""
End If
If .BOF And .EOF Then
intSpKey = 0
Else
intSpKey = !spzd_key
End If
.Close
End With
End Sub
Private Sub cmbSpmc_Change()
If Trim(txtHh.Text) <> "" And Trim(cmbSpdm.Text) <> "" And Trim(cmbSpmc.Text) <> "" And Trim(txtJhjg.Text) <> "" And Trim(txtJhsl.Text) <> "" Then
cmdAdd.Enabled = True
Else
cmdAdd.Enabled = False
End If
End Sub
Private Sub cmbSpmc_Click()
' With rstMain
' If .State = adStateOpen Then .Close
' .Open "select * from spzd where spmc='" & cmbSpmc.Text & "'"
' If .BOF And .EOF Then
' intSpKey = 0
' Else
' intSpKey = !spzd_key
' End If
' .Close
' End With
End Sub
Private Sub cmdAdd_Click()
Dim itmX 'As ListItem
Dim lngKey As Long
With rstMain
If .State = adStateOpen Then .Close
.Open "select * from spxx where hh='" & Trim(txtHh.Text) & "'"
If Not .BOF Or Not .EOF Then
MsgBox "此货号商品已经存在,请输入其他的商品货号!", vbExclamation, "进销存系统"
.Close
Exit Sub
End If
.Close
.Open "select * from spxx"
.AddNew
!hh = Trim(txtHh.Text)
!spzd_key = intSpKey
!jhrq = dtpJhrq.Value
!jhdj = CCur(txtJhjg.Text)
!jhsl = txtJhsl.Text
!xssl = 0
!kcsl = txtJhsl.Text
.Update
lngKey = !spxx_key
.Close
' Set itmX = frmMain.lvw.ListItems.Add(, "spxx" & CStr(lngKey), Trim(txtHh.Text))
' itmX.SubItems(1) = Trim(cmbSpdm.Text)
' itmX.SubItems(2) = Trim(cmbSpmc.Text)
' itmX.SubItems(3) = dtpJhrq.Value
' itmX.SubItems(4) = Trim(txtJhjg.Text)
' itmX.SubItems(5) = Trim(txtJhsl.Text)
' itmX.SubItems(6) = 0
' itmX.SubItems(7) = Trim(txtJhsl.Text)
End With
cmdClear_Click
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClear_Click()
txtHh.Text = ""
cmbSpdm.Text = ""
cmbSpmc.Text = ""
txtJhjg.Text = ""
txtJhsl.Text = ""
dtpJhrq.Value = Date$
End Sub
Private Sub Form_Load()
intSpKey = 0
With rstMain
If .State = adStateOpen Then .Close
cmbSpdm.Clear
cmbSpmc.Clear
.Open "select * from spzd"
If Not .BOF Then .MoveFirst
While Not .EOF
cmbSpdm.AddItem !spdm & ""
cmbSpmc.AddItem !spmc & ""
.MoveNext
Wend
.Close
End With
dtpJhrq.Value = Date$
End Sub
Private Sub txtJhjg_Change()
If Trim(txtHh.Text) <> "" And Trim(cmbSpdm.Text) <> "" And Trim(cmbSpmc.Text) <> "" And Trim(txtJhjg.Text) <> "" And Trim(txtJhsl.Text) <> "" Then
cmdAdd.Enabled = True
Else
cmdAdd.Enabled = False
End If
End Sub
Private Sub txtJhjg_KeyPress(KeyAscii As Integer)
If KeyAscii <> Asc(0) And KeyAscii <> Asc(1) And KeyAscii <> Asc(2) And KeyAscii <> Asc(3) And KeyAscii <> Asc(4) And KeyAscii <> Asc(5) And KeyAscii <> Asc(6) And KeyAscii <> Asc(7) And KeyAscii <> Asc(8) And KeyAscii <> Asc(9) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub txtJhsl_Change()
If Trim(txtHh.Text) <> "" And Trim(cmbSpdm.Text) <> "" And Trim(cmbSpmc.Text) <> "" And Trim(txtJhjg.Text) <> "" And Trim(txtJhsl.Text) <> "" Then
cmdAdd.Enabled = True
Else
cmdAdd.Enabled = False
End If
End Sub
Private Sub txtJhsl_KeyPress(KeyAscii As Integer)
If KeyAscii <> Asc(0) And KeyAscii <> Asc(1) And KeyAscii <> Asc(2) And KeyAscii <> Asc(3) And KeyAscii <> Asc(4) And KeyAscii <> Asc(5) And KeyAscii <> Asc(6) And KeyAscii <> Asc(7) And KeyAscii <> Asc(8) And KeyAscii <> Asc(9) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -