📄 frm_xxlr.frm
字号:
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker3.SetFocus
Else
End If
End Sub
Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker1.SetFocus
Else
End If
End Sub
Private Sub DTPicker3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo3.SetFocus
Else
End If
End Sub
Private Sub Form_Activate()
Combo1.Clear
Adodc1.RecordSource = "select * from Table_ZCXX order by 资产设备名称 "
Adodc1.Refresh
Do While Adodc1.Recordset.EOF = False
tep1 = Adodc1.Recordset.Fields("资产设备名称").Value
If tep1 <> tep2 Then
Combo1.AddItem (tep1)
tep2 = tep1
Adodc1.Recordset.MoveNext
ElseIf tep1 = tep2 Then
Adodc1.Recordset.MoveNext
End If
Loop
Combo5.Clear
frm_BMWH.Adodc1.RecordSource = "select * from Table_BMB"
frm_BMWH.Adodc1.Refresh
Do While frm_BMWH.Adodc1.Recordset.EOF = False
tep1 = frm_BMWH.Adodc1.Recordset.Fields("部门名称").Value
If tep1 <> tep2 Then
Combo5.AddItem (tep1)
tep2 = tep1
frm_BMWH.Adodc1.Recordset.MoveNext
ElseIf tep1 = tep2 Then
frm_BMWH.Adodc1.Recordset.MoveNext
End If
Loop
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
DTPicker2.Value = Date
DTPicker3.Value = Date
Adodc1.RecordSource = "select * from Table_ZCXX order by 资产设备编号"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Adodc1.Recordset.Fields("资产设备编号")
Text1.Text = Val(Text1.Text) + 1
Else
Text1.Text = 10000
End If
If frm_zdysz.Text1.Text = "" Then
Label25.Caption = "自定义项1"
Else
Label25.Caption = frm_zdysz.Text1.Text
End If
If frm_zdysz.Text2.Text = "" Then
Label27.Caption = "自定义项2"
Else
Label27.Caption = frm_zdysz.Text2.Text
End If
If frm_zdysz.Text3.Text = "" Then
Label29.Caption = "自定义项3"
Else
Label29.Caption = frm_zdysz.Text3.Text
End If
If frm_zdysz.Text4.Text = "" Then
Label26.Caption = "自定义项4"
Else
Label26.Caption = frm_zdysz.Text4.Text
End If
If frm_zdysz.Text5.Text = "" Then
Label28.Caption = "自定义项5"
Else
Label28.Caption = frm_zdysz.Text5.Text
End If
If frm_zdysz.Text6.Text = "" Then
Label30.Caption = "自定义项6"
Else
Label30.Caption = frm_zdysz.Text6.Text
End If
If frm_zdysz.Text7.Text = "" Then
Label31.Caption = "自定义项7"
Else
Label31.Caption = frm_zdysz.Text7.Text
End If
If frm_zdysz.Text8.Text = "" Then
Label33.Caption = "自定义项8"
Else
Label33.Caption = frm_zdysz.Text8.Text
End If
If frm_zdysz.Text9.Text = "" Then
Label34.Caption = "自定义项9"
Else
Label34.Caption = frm_zdysz.Text9.Text
End If
If frm_zdysz.Text10.Text = "" Then
Label32.Caption = "自定义项10"
Else
Label32.Caption = frm_zdysz.Text10.Text
End If
If frm_zdysz.Text11.Text = "" Then
Label35.Caption = "自定义项11"
Else
Label35.Caption = frm_zdysz.Text11.Text
End If
If frm_zdysz.Text12.Text = "" Then
Label36.Caption = "自定义项12"
Else
Label36.Caption = frm_zdysz.Text12.Text
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1.SetFocus
Else
End If
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text14.SetFocus
Else
End If
End Sub
Private Sub Text10_LostFocus()
If Text10.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text10.Text) < 48 Or Asc(Text10.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text10.Text = ""
Text10.SetFocus
Else
End If
End If
End Sub
Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo7.SetFocus
Else
End If
End Sub
Private Sub Text11_LostFocus()
If Text11.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text11.Text) < 48 Or Asc(Text11.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text11.Text = ""
Text11.SetFocus
Else
End If
End If
End Sub
Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text15.SetFocus
Else
End If
End Sub
Private Sub Text12_LostFocus()
If Text12.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text12.Text) < 48 Or Asc(Text12.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text12.Text = ""
Text12.SetFocus
Else
End If
End If
End Sub
Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text15.SetFocus
Else
End If
End Sub
Private Sub Text13_LostFocus()
If Text13.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text13.Text) < 48 Or Asc(Text13.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text13.Text = ""
Text13.SetFocus
Else
End If
End If
If Val(Text13.Text) > Val(Text10.Text) Then
MsgBox "净残值不能大于金额!!", , "提示"
Text13.Text = ""
Text13.SetFocus
Else
Text12.Text = Val(Text10.Text) - Val(Text13.Text)
End If
End Sub
Private Sub Text14_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo7.SetFocus
Else
End If
End Sub
Private Sub Text14_LostFocus()
Dim a
If Text14.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text14.Text) < 48 Or Asc(Text14.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text14.Text = ""
Text14.SetFocus
Else
End If
End If
Text11.Text = 1 / Val(Text14.Text)
a = Str(Text11.Text)
Text11.Text = Left$(a, 4)
End Sub
Private Sub Text15_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text17.SetFocus
Else
End If
End Sub
Private Sub Text16_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text18.SetFocus
Else
End If
End Sub
Private Sub Text17_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text19.SetFocus
Else
End If
End Sub
Private Sub Text18_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text20.SetFocus
Else
End If
End Sub
Private Sub Text19_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text16.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub Text20_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text21.SetFocus
Else
End If
End Sub
Private Sub Text21_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text22.SetFocus
Else
End If
End Sub
Private Sub Text22_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text23.SetFocus
Else
End If
End Sub
Private Sub Text23_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text24.SetFocus
ElseIf KeyCode = 39 Then
Text24.SetFocus
End If
End Sub
Private Sub Text24_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text25.SetFocus
Else
End If
End Sub
Private Sub Text25_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text26.SetFocus
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo2.SetFocus
Else
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text5.SetFocus
Else
End If
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker2.SetFocus
Else
End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text8.SetFocus
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
Else
End If
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text9.SetFocus
Else
End If
End Sub
Private Sub Text8_LostFocus()
If Text8.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text8.Text) < 48 Or Asc(Text8.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text8.Text = ""
Text8.SetFocus
Else
End If
End If
Text10.Text = Val(Text8.Text) * Val(Text9.Text)
End Sub
Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text10.SetFocus
Else
End If
End Sub
Private Sub Text9_LostFocus()
If Text9.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text9.Text) < 48 Or Asc(Text9.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text9.Text = ""
Text9.SetFocus
Else
End If
End If
Text10.Text = Val(Text8.Text) * Val(Text9.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -