📄 frmmaindate.frm
字号:
Width = 1335
End
Begin VB.Label Label7
Caption = "库存类别:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 15
Top = 4176
Width = 1335
End
Begin VB.Label Label6
Caption = "货品类别:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 14
Top = 1680
Width = 1335
End
Begin VB.Label Label5
Caption = "单 位:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 13
Top = 3480
Width = 1095
End
Begin VB.Label Label4
Caption = "颜 色:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 12
Top = 3552
Width = 1335
End
Begin VB.Label Label3
Caption = "规 格:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 11
Top = 2928
Width = 1335
End
Begin VB.Label Label2
Caption = "材料名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 10
Top = 2304
Width = 1335
End
Begin VB.Label Label1
Caption = "助记码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4680
TabIndex = 9
Top = 2280
Width = 1095
End
End
Attribute VB_Name = "frmmaindata"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As ADODB.Recordset
Private i As Integer
Private Sub color_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub comadd_Click()
If Trim(stuffname) = "" Or Trim(stuffclass.Text) = "" Or Trim(unit) = "" Or Trim(initlib) = "" Or Trim(libclass.Text) = "" Then
MsgBox "输入资料不完整!"
Exit Sub
End If
Set rs = New ADODB.Recordset
rs.Open "select * from stuffdatatable ", GetConnect, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![helpcode] = Trim(Me.helpcode)
rs![Name] = Trim(stuffname)
rs![kind] = Trim(Me.kind)
rs![color] = Trim(Me.color.Text)
rs![unit] = Trim(Me.unit)
rs![stuffclass] = Mid(stuffclass.SelectedItem.Key, 2, 100)
rs![libclass] = Mid(libclass.SelectedItem.Key, 2, 100)
rs![initlib] = Trim(initlib)
rs![supply] = Trim(Me.supply.Text)
rs.Update
rs.Close
Me.helpcode = ""
Me.initlib = ""
End Sub
Private Sub combrow_Click()
FrmdataBrow.Show vbModal
End Sub
Private Sub comcancel_Click()
Unload Me
End Sub
Private Sub comok_Click()
If Trim(stuffname) = "" Or Trim(stuffclass.Text) = "" Or Trim(unit) = "" Or Trim(initlib) = "" Or Trim(libclass.Text) = "" Then
MsgBox "输入资料不完整!"
Exit Sub
End If
If Not IsNumeric(Trim(initlib)) Then
MsgBox "初始库存内输入的不是数字!"
Exit Sub
End If
If Not IsNumeric(Trim(initlib)) Then
MsgBox "初始库存内输入的不是数字!"
Exit Sub
End If
Set rs = New ADODB.Recordset
rs.Open "select * from stuffdatatable ", GetConnect, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![helpcode] = Trim(Me.helpcode)
rs![Name] = Trim(stuffname)
rs![kind] = Trim(Me.kind)
rs![color] = Trim(Me.color.Text)
rs![unit] = Trim(Me.unit)
rs![stuffclass] = Mid(stuffclass.SelectedItem.Key, 2, 100)
rs![libclass] = Mid(libclass.SelectedItem.Key, 2, 100)
rs![initlib] = Trim(initlib)
rs![supply] = Trim(Me.supply.Text)
rs.Update
rs.Close
Unload Me
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.Open "select * from libclasstable ", GetConnect, adOpenStatic, adLockReadOnly
libclass.ComboItems.Clear
If rs.EOF And rs.BOF Then
MsgBox " 无资料 "
End If
For i = 1 To rs.RecordCount
libclass.ComboItems.Add , "_" & rs![Name], Trim(rs![memo])
rs.MoveNext
Next i
rs.Close
Set rs = New ADODB.Recordset
rs.Open "select * from stuffclasstable ", GetConnect, adOpenStatic, adLockReadOnly
stuffclass.ComboItems.Clear
If rs.EOF And rs.BOF Then
MsgBox "库存类别无资料!"
End If
For i = 1 To rs.RecordCount
stuffclass.ComboItems.Add , "_" & rs![ID], Trim(rs![Name])
rs.MoveNext
Next i
rs.Close
Set rs = New ADODB.Recordset
rs.Open "select distinct color from stuffdatatable where color <> ''", GetConnect, adOpenStatic, adLockReadOnly
color.Clear
If rs.EOF And rs.BOF Then
MsgBox "无资料!"
End If
For i = 1 To rs.RecordCount
color.AddItem Trim(rs![color])
rs.MoveNext
Next i
rs.Close
Set rs = New ADODB.Recordset
rs.Open "select distinct unit from stuffdatatable ", GetConnect, adOpenStatic, adLockReadOnly
unit.Clear
If rs.EOF And rs.BOF Then
MsgBox "无资料!"
End If
For i = 1 To rs.RecordCount
unit.AddItem Trim(rs![unit])
rs.MoveNext
Next i
rs.Close
Set rs = New ADODB.Recordset
rs.Open "select distinct supply from stuffdatatable where supply <> ''", GetConnect, adOpenStatic, adLockReadOnly
supply.Clear
If rs.EOF And rs.BOF Then
MsgBox "无资料!"
End If
For i = 1 To rs.RecordCount
supply.AddItem Trim(rs![supply])
rs.MoveNext
Next i
rs.Close
End Sub
Private Sub helpcode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub initlib_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub initlib_KeyPress(KeyAscii As Integer)
If (KeyAscii < 45 Or KeyAscii > 57) And KeyAscii <> 47 And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub kind_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub libclass_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub stuffclass_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub stuffname_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub unit_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
SendKeys "{tab}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -