📄 frmgoodssub.frm
字号:
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2880
TabIndex = 10
Top = 240
Width = 1530
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "编号:"
Height = 180
Left = 240
TabIndex = 9
Top = 900
Width = 450
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品条形码:"
Height = 180
Index = 0
Left = 240
TabIndex = 8
Top = 1320
Width = 990
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注:"
Height = 180
Left = 360
TabIndex = 7
Top = 3720
Width = 450
End
Begin VB.Line Line1
BorderColor = &H0034A70E&
X1 = 120
X2 = 7200
Y1 = 1150
Y2 = 1150
End
Begin VB.Line Line2
BorderColor = &H0034A70E&
Index = 0
X1 = 120
X2 = 7200
Y1 = 1560
Y2 = 1560
End
Begin VB.Line Line5
BorderColor = &H0034A70E&
X1 = 1320
X2 = 1320
Y1 = 720
Y2 = 4080
End
End
End
End
Attribute VB_Name = "frmGoodsSub"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim intC As Integer
If TableState = "增加" Then
sSQL = "select * from Goods where gCode='" & Trim(Me.txtgCode) & "'"
If Rs.State <> 0 Then Rs.Close
Set Rs = Conn.Execute(sSQL)
If Not Rs.EOF Then
MsgBox "编号 [ " & Trim(Me.txtgCode) & " ] 不唯一!", vbInformation, "提示窗口"
SendNext Me.txtgCode
Exit Sub
End If
sSQL = "select * from Goods where gName='" & Trim(Me.txtgName) & "' and gModel='" & Trim(Me.txtgModel) & "'"
If Rs.State <> 0 Then Rs.Close
Set Rs = Conn.Execute(sSQL)
If Not Rs.EOF Then
MsgBox "编号 [ " & Trim(Me.txtgName) & " " & Trim(Me.txtgModel) & " ] 的物资资料已存在!", vbInformation, "提示窗口"
SendNext Me.txtgName
Exit Sub
End If
Else
sSQL = "delete from Goods where gCode='" & Trim(frmGoodsAll.mshfView.TextMatrix(frmGoodsAll.mshfView.RowSel, 1)) & "'"
Conn.Execute sSQL
End If
'读取日期时间,应该读取服务器的时间日期限
EditDate = Format(Date, "yyyy-MM-dd")
EditTime = Format(Time, "hh:mm:ss")
sSQL = "insert into Goods("
sSQL = sSQL & "gCode" & ","
sSQL = sSQL & "gBarCode" & ","
sSQL = sSQL & "gName" & ","
sSQL = sSQL & "gModel" & ","
sSQL = sSQL & "gUnits" & ","
sSQL = sSQL & "gPrice" & ","
sSQL = sSQL & "gPriceCost" & ","
sSQL = sSQL & "gEditDate" & ","
sSQL = sSQL & "gEditTime" & ","
sSQL = sSQL & "gRemark" & ")"
sSQL = sSQL & "values('"
sSQL = sSQL & CheckEmpty(Me.txtgCode) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgBarCode) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgName) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgModel) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgUnits) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgPrice) & "','"
sSQL = sSQL & CheckEmpty(Me.txtgPriceCost) & "','"
sSQL = sSQL & Format(EditDate, "yyyy-MM-dd") & "','"
sSQL = sSQL & Format(EditTime, "hh:mm:ss") & "','"
sSQL = sSQL & CheckEmpty(Me.txtgRemark) & "')"
Conn.Execute sSQL
If TableState = "修改" Then
'更新BillSub
sSQL = "update BillSub set "
sSQL = sSQL & " bGoodsCode='" & Trim(Me.txtgCode) & "',"
sSQL = sSQL & " bGoodsBar='" & Trim(Me.txtgBarCode) & "',"
sSQL = sSQL & " bGoodsName='" & Trim(Me.txtgName) & " " & Trim(Me.txtgModel) & "',"
sSQL = sSQL & " bGoodsUnits='" & Trim(Me.txtgUnits) & "'"
sSQL = sSQL & " where bGoodsCode<>' ' and bGoodsCode<>'' and bGoodsCode='" & Trim(frmGoodsAll.mshfView.TextMatrix(frmGoodsAll.mshfView.RowSel, 1)) & "'"
Conn.Execute sSQL
'更新Total
sSQL = "update Total set "
sSQL = sSQL & " gCode='" & Trim(Me.txtgCode) & "',"
sSQL = sSQL & " gBarcode='" & Trim(Me.txtgBarCode) & "'"
sSQL = sSQL & " where gCode<>' ' and gCode<>'' and gCode='" & Trim(frmGoodsAll.mshfView.TextMatrix(frmGoodsAll.mshfView.RowSel, 1)) & "'"
Conn.Execute sSQL
'添加日志
End If
Me.cmdSave.Enabled = False
'显示数据
'sSQL = "SELECT Goods.gCode, Goods.gBarCode,Goods.gGAddress, Goods.gName, Goods.gModel, Goods.gUnits, GoodsStyle.gcName, Goods.gMaxTotal, Goods.gMinTotal, Goods.gRemark"
'sSQL = sSQL & " from Goods,GoodsStyle"
'sSQL = sSQL & " where Goods.gSuppliesType = GoodsStyle.gcCode "
'sSQL = sSQL & " order by gcode asc" 'order by gcCode"
'If Rs.State <> 0 Then Rs.Close
'Set Rs = Conn.Execute(sSQL)
'Set frmGoodsAll.mshfView.Recordset = Rs
'Call Setcaption(frmGoodsAll.mshfView, "序号;物资编码;商品条形码;货柜号;商品名称;规格型号;计量单位;物资类别;最高库存;最低库存;备注;")
'With frmGoodsAll.mshfView
' .ColWidth(0) = 255 * 2
' .ColWidth(1) = 255 * 4
' .ColWidth(2) = 255 * 6
' .ColWidth(3) = 255 * 4
' .ColWidth(4) = 255 * 8
' .ColWidth(5) = 255 * 6
' .ColWidth(6) = 255 * 4
' .ColWidth(7) = 255 * 4
' .ColWidth(8) = 255 * 4
' .ColWidth(9) = 255 * 4
' .ColWidth(10) = 255 * 12
' .ColAlignment(1) = 1
' .ColAlignment(2) = 1
' .ColAlignment(3) = 1
' .ColAlignment(4) = 1
' .ColAlignment(5) = 1
'End With
'Call CreateSerial(frmGoodsAll.mshfView)
'frmGoodsAll.lblTotal = frmGoodsAll.mshfView.Rows - 1
'frmGoodsAll.lblTotal = ShowData(sSQL, frmGoodsAll.mshfView, 30)
End Sub
Private Sub Form_Load()
If TableState = "显示" Or TableState = "修改" Then
If frmGoodsAll.mshfView.TextMatrix(frmGoodsAll.mshfView.RowSel, 1) = "" Then
Exit Sub
End If
sSQL = "SELECT Goods.gCode, Goods.gBarCode, Goods.gName, Goods.gModel, Goods.gUnits, Goods.gPrice, Goods.gPriceCost, Goods.gRemark"
sSQL = sSQL & " from Goods"
sSQL = sSQL & " order by gCode asc"
If Rs.State <> 0 Then Rs.Close
Set Rs = Conn.Execute(sSQL)
If Not Rs.EOF Then
With frmGoodsSub
.txtgCode = Rs.Fields("gCode") & ""
.txtgBarCode = Rs.Fields("gBarCode") & ""
.txtgName = Rs.Fields("gName") & ""
.txtgModel = Rs.Fields("gModel") & ""
.txtgUnits = Rs.Fields("gUnits") & ""
.txtgPrice = Rs.Fields("gPrice") & ""
.txtgPriceCost = Rs.Fields("gPriceCost") & ""
.txtgRemark = Rs.Fields("gRemark") & ""
End With
End If
End If
End Sub
Private Sub txtgCode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendNext Me.txtgBarCode
End If
End Sub
Private Sub txtgGAddress_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendNext Me.txtgName
End If
End Sub
Private Sub txtgModel_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendNext Me.txtgUnits
End If
End Sub
Private Sub txtgName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendNext Me.txtgModel
End If
End Sub
Private Sub txtgPrice_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Me.txtgPrice = Format(Me.txtgPrice, "0.00")
End If
End Sub
Private Sub txtgPrice_LostFocus()
Me.txtgPrice = Format(Me.txtgPrice, "0.00")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -