📄 inout.frm
字号:
Call main
If Text16.Text = "" Then
MsgBox "请输入资产设备编号"
Text16.SetFocus
Exit Sub
Else
If Frame4.Visible = True Then
If Val(Text28.Text) > Val(Text26.Text) Then
MsgBox "输入的归还数量不正确", 32, "通用固定资产设备管理系统"
Text28.Text = ""
Text28.SetFocus
Else
Text28.Text = Val(Text28.Text) + Val(Text34.Text)
Adodc2.RecordSource = "select * from Table_ZCXX where 资产设备编号='" + Text16.Text + "'"
Adodc2.Refresh
Dim aa As Integer
aa = Val(Adodc2.Recordset.Fields("数量")) + Val(Text34.Text)
Set adoRs = adoCon.Execute("UPDATE Table_INOUT SET 归还数量= '" + Text28.Text + "',归还日期= '" + Str(DTPicker5.Value) + "',未还数量= '" + Text31.Text + "' where 资产设备编号='" + Text16.Text + "'")
Set adoRs = adoCon.Execute("UPDATE Table_ZCXX SET 借出数量= '" + Text31.Text + "',数量= '" + Str(aa) + "' where 资产设备编号='" + Text16.Text + "'")
Adodc1.Recordset.UpdateBatch
MsgBox "数据保存成功!!", , "提示"
End If
Else
End If
End If
adoCon.Close
End Sub
Private Sub Comd4_Click(Index As Integer)
Frame1.Visible = True
Frame4.Visible = False
End Sub
Private Sub Comd5_Click(Index As Integer)
Text16.SetFocus
Frame1.Visible = False
Frame4.Visible = True
End Sub
Private Sub Command1_Click()
Dim a
a = Text7.Text
If I = 0 Then
Adodc1.RecordSource = "select * from Table_INOUT where " + Combo1.Text + ">'" + a + "'"
Adodc1.Refresh
ElseIf I = 1 Then
Adodc1.RecordSource = "select * from Table_INOUT where " + Combo1.Text + "='" + a + "'"
Adodc1.Refresh
ElseIf I = 2 Then
Adodc1.RecordSource = "select * from Table_INOUT where " + Combo1.Text + "<'" + a + "'"
Adodc1.Refresh
ElseIf I = 3 Then
Adodc1.RecordSource = "select * from Table_INOUT where " + Combo1.Text + " Like '%" + a + "%'"
Adodc1.Refresh
Else
End If
End Sub
Private Sub Command3_Click(Index As Integer)
End Sub
Private Sub Command4_Click(Index As Integer)
End Sub
Private Sub Command5_Click(Index As Integer)
End Sub
Private Sub Command6_Click()
Text25.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
Text10.Enabled = False
Text11.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Text14.Enabled = False
Text15.Enabled = False
Adodc1.RecordSource = "select * from Table_INOUT order by 资产设备编号"
Adodc1.Refresh
End Sub
Private Sub Command7_Click()
frm_INOUT.Hide
End Sub
Private Sub Command8_Click()
DataEnvironment1.rsCommand3.Open "select * from Table_INOUT where 资产设备编号 like '" + Text16.Text + "'+ '%'order by 资产设备编号"
If DataEnvironment1.rsCommand3.RecordCount > 0 Then
DataRep_INOUT.Show
Else
MsgBox "此设备编号不存在,请确认后重新输入"
DataEnvironment1.rsCommand3.Close
End If
End Sub
Private Sub Command9_Click()
CommonDialog1.ShowPrinter
End Sub
Private Sub DTPicker5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text28.SetFocus
Else
End If
End Sub
Private Sub Form_Activate()
Frame1.Visible = True
Frame4.Visible = False
End Sub
Private Sub Form_Load()
Text33.Text = Text28.Text
DTPicker5.Value = Date
DTPicker1.Value = Date
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim I, Length As Integer
I = 1
StrInput = Text1.Text
Length = Len(StrInput)
If Text1.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text1.SetFocus
Else
Do While (I <= Length)
Temp = Mid$(StrInput, I, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If I = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text1.Text = ""
Text1.SetFocus
Else
End If
I = I + 1
Loop
If Text1.Text = "" Then
Text1.SetFocus
Else
Adodc2.RecordSource = "select * from Table_ZCXX where 资产设备编号='" + Text1.Text + "'"
Adodc2.Refresh
Text2.SetFocus
End If
End If
Else
End If
End Sub
Private Sub Text16_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim I, Length As Integer
I = 1
StrInput = Text16.Text
Length = Len(StrInput)
If Text16.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text16.SetFocus
Else
Do While (I <= Length)
Temp = Mid$(StrInput, I, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If I = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text16.Text = ""
Text16.SetFocus
Else
End If
I = I + 1
Loop
If Text16.Text = "" Then
Text16.SetFocus
Else
Adodc1.RecordSource = "select * from Table_INOUT where 资产设备编号='" + Text16.Text + "'"
Adodc1.Refresh
Text18.SetFocus
End If
End If
End If
End Sub
Private Sub Text18_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text26.SetFocus
ElseIf KeyCode = 39 Then
Text26.SetFocus
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
ElseIf KeyCode = 39 Then
Text5.SetFocus
End If
End Sub
Private Sub Text26_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker5.SetFocus
ElseIf KeyCode = 39 Then
DTPicker5.SetFocus
End If
End Sub
Private Sub Text27_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim I, Length As Integer
I = 1
StrInput = Text27.Text
Length = Len(StrInput)
If Text27.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text27.SetFocus
Else
Do While (I <= Length)
Temp = Mid$(StrInput, I, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If I = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text27.Text = ""
Text27.SetFocus
Else
End If
I = I + 1
Loop
If Text27.Text = "" Then
Text27.SetFocus
Else
If Val(Trim(Text27.Text)) > Val(Trim(Text32.Text)) Then
MsgBox "输入固定资产的借出数量大于实际固定资产的总数,请您重新输入", 32, "通用固定资产设备管理系统"
Text27.Text = ""
Text27.SetFocus
Else
DTPicker1.SetFocus
End If
End If
End If
Else
End If
End Sub
Private Sub Text28_Change()
'Text28.Text = Text33.Text
Text31.Text = Val(Text26.Text) - Val(Text28.Text)
If Val(Text28.Text) > Val(Text26.Text) Then
MsgBox "归还数量不应该大于借出数量!", 48, "提示"
Text28.Text = Text33.Text
Text34.Text = ""
Text34.SetFocus
'Text28.SetFocus
Else
End If
End Sub
Private Sub Text28_GotFocus()
Text33.Text = Text28.Text
End Sub
Private Sub Text34_LostFocus()
'Text28.Text = Val(Text28.Text) + Val(Text34.Text)
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
ElseIf KeyCode = 39 Then
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text27.SetFocus
ElseIf KeyCode = 39 Then
Text27.SetFocus
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If I = 0 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 资产设备编号 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 1 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 资产名称 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 2 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 型号 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 3 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 配置 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 4 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 数量 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 4 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 借用部门 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 5 Then
If Text7.Text = "" Then
MsgBox "请输入查询内容", , "提示"
Else
Adodc1.RecordSource = "select * from Table_INOUT where 借用人 ='" + Text7.Text + "'"
Adodc1.Refresh
End If
ElseIf I = 6 Then
Dim aa
aa = DTPicker3.Value
Text7.Text = aa
Adodc1.RecordSource = "select * from Table_INOUT where 借出日期 ='" + Text7.Text + "'"
Adodc1.Refresh
ElseIf I = 7 Then
Dim bb
bb = DTPicker3.Value
Text7.Text = bb
Adodc1.RecordSource = "select * from Table_INOUT where 归还日期 ='" + Text7.Text + "'"
Adodc1.Refresh
Text7.Text = ""
End If
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -