📄 xsgl.frm
字号:
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数 量:"
Height = 180
Index = 2
Left = 7080
TabIndex = 19
Top = 840
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品名称:"
Height = 180
Index = 1
Left = 3720
TabIndex = 18
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "申领单位:"
Height = 180
Index = 0
Left = 360
TabIndex = 17
Top = 360
Width = 900
End
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 600
Top = 960
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "spsz"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 480
Top = 1200
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "bmsz"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc3
Height = 330
Left = 840
Top = 3000
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=\ltgl\ltgl.mdb"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT * FROM RKGL"
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If DataCombo1.Text <> "" And DataCombo2.Text <> "" And Text3.Text <> "" And Text8.Text <> "" And Text1.Text <> "" Then
aa = MsgBox("真的要出库吗?", 1, "消息")
If aa = 1 Then
Command2.Enabled = False
'出库表增加
Adodc4.Recordset.AddNew
Adodc4.Recordset("申领部门") = DataCombo1.Text
Adodc4.Recordset("商品名称") = DataCombo2.Text
Adodc4.Recordset("型号") = Text2.Text
Adodc4.Recordset("单价") = Text4.Text
Adodc4.Recordset("数量") = Text3.Text
Adodc4.Recordset("单位") = Text6.Text
Adodc4.Recordset("总金额") = Text5.Text
Adodc4.Recordset("入库日期") = Text7.Text
Adodc4.Recordset("办理人") = Text9.Text
Adodc4.Recordset("申领人") = Text8.Text
Adodc4.Recordset("出库日期") = DTPicker1.Value
Adodc4.Recordset("出库单号") = Text1.Text
Adodc4.Recordset.Update
DataGrid2.Refresh
DataEnvironment1.Command1 Text3.Text, Text3.Text, DataCombo2.Text, Text2.Text, Text7.Text
Adodc3.RecordSource = "select * from rkgl"
Adodc3.Refresh
Set DataGrid1.DataSource = Adodc3
DataGrid1.Refresh
DataCombo1.Text = ""
DataCombo2.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
DataEnvironment1.Command6
If Text2.Text <> "" Then
ss = "SELECT * FROM RKGL where 商品名称='" & RTrim(DataCombo2.Text) & "' AND 型号='" & RTrim(Text2.Text) & "'"
Else
ss = "SELECT * FROM RKGL where 商品名称='" & RTrim(DataCombo2.Text) & "'"
End If
Adodc3.RecordSource = ss
Adodc3.Refresh
Set DataGrid1.DataSource = Adodc3
DataGrid1.Refresh
Form1.Refresh
End If
Else
MsgBox "数据不全,请检查数据!"
End If
End Sub
Private Sub Command2_Click()
DataEnvironment1.Command4
Unload Form1
End Sub
Private Sub Command3_Click()
aa = MsgBox("真的要出库打印吗?", 1, "消息")
If aa = 1 Then
DataReport1.Show 1
DataEnvironment1.Command12
Command2.Enabled = True
End If
End Sub
Private Sub Command4_Click()
DataEnvironment1.Command12
End Sub
Private Sub Command5_Click()
DataCombo1.Text = ""
DataCombo2.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Private Sub DataCombo1_Change()
DataCombo2.SetFocus
End Sub
Private Sub DataCombo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub DataCombo2_Change()
DataGrid1.SetFocus
DataGrid1.Refresh
End Sub
Private Sub DataCombo2_Click(Area As Integer)
Text6.Text = DataCombo2.BoundText
If Text2.Text <> "" Then
ss = "SELECT * FROM RKGL where 商品名称='" & RTrim(DataCombo2.Text) & "' AND 型号='" & RTrim(Text2.Text) & "'"
Else
ss = "SELECT * FROM RKGL where 商品名称='" & RTrim(DataCombo2.Text) & "'"
End If
Adodc3.RecordSource = ss
Adodc3.Refresh
Set DataGrid1.DataSource = Adodc3
DataGrid1.Refresh
End Sub
Private Sub DataCombo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub DataCombo2_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
If Adodc3.Recordset.EOF = False And Adodc3.Recordset.BOF = False Then
DataCombo2.Text = Adodc3.Recordset("商品名称")
Text2.Text = Adodc3.Recordset("型号")
Text4.Text = Adodc3.Recordset("单价")
Text6.Text = Adodc3.Recordset("单位")
Text10.Text = Adodc3.Recordset("数量")
Text7.Text = Adodc3.Recordset("入库日期")
Text3.Text = ""
Text5.Text = ""
Text8.Text = ""
Text9.Text = ""
Else
MsgBox "没有数据!"
DataCombo2.SetFocus
End If
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub Text3_Change()
If Text3.Text <> "" Then
Text5.Text = Text3.Text * Text4.Text
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub Text3_LostFocus()
If Val(Text3.Text) > Val(Text10.Text) Then
MsgBox "数据不能不能大于库存数量,请输入数据!"
Text3.Text = ""
Text3.SetFocus
End If
End Sub
Private Sub Text6_Change()
DataCombo2.BoundText = Text6.Text
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -