📄 hy_zymx.frm
字号:
End Sub
Private Sub m_qsrq_LostFocus()
If Frame2.Enabled = True Then
If Not m_qsrq.Text = " - - " Then
If IsDate(m_qsrq.Text) Then
If CDate(Trim(m_qsrq.Text)) >= Date Then
m_jzrq.SetFocus
Else
frm_msg.Visible = True
frm_msg.Caption = "无效起用日期!!"
m_qsrq.SetFocus
m_qsrq.SelStart = 0
m_qsrq.SelLength = Len(m_qsrq.Text)
End If
Else
frm_msg.Visible = True
frm_msg.Caption = "无效起用日期!!"
m_qsrq.SetFocus
m_qsrq.SelStart = 0
m_qsrq.SelLength = Len(m_qsrq.Text)
End If
End If
End If
End Sub
Private Sub m_zydm_Change()
frm_msg.Caption = ""
End Sub
Private Sub m_zydm_GotFocus()
m_zydm.SelStart = 0
m_zydm.SelLength = Len(Trim(m_zydm.Text))
End Sub
Private Sub m_zydm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_zydm_LostFocus
End If
End Sub
Private Sub m_zydm_LostFocus()
If Frame2.Enabled = True Then
Dim LS_REC1 As Recordset
If Not Trim(m_zydm.Text) = "" Then
Set LS_REC1 = YX_data.OpenRecordset("select ZYDM,ZYMC,DJ,ZYDW from HY_ZYK where TRIM(ZYDM)='" & Trim(UCase(m_zydm.Text)) & " '", 4)
If LS_REC1.BOF Then
frm_msg.Caption = "资源代码不存在!"
m_zydm.SetFocus
Else
LS_REC1.MoveLast
m_zymc.Text = Trim(LS_REC1!ZYMC)
m_zydw.Text = LS_REC1!ZYDW
m_dj.Text = LS_REC1!DJ
m_qsrq.SetFocus
End If
Else
If m_zymc.Enabled = False Then
m_zymc.Enabled = True
m_zymc.SetFocus
Else
m_zymc.SetFocus
End If
End If
End If
End Sub
Private Sub m_zydw_Change()
If Not frm_msg.Caption = "" Then
frm_msg.Caption = ""
End If
End Sub
Private Sub m_zymc_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_zymc_LostFocus
End If
End Sub
Private Sub m_zymc_LostFocus()
If Frame2.Enabled = True Then
Dim LS_REC1 As Recordset
If Not Trim(m_zymc.Text) = "" Then
Set LS_REC1 = YX_data.OpenRecordset("select ZYDM,ZYMC,DJ,ZYDW from HY_ZYK where TRIM(ZYMC)='" & Trim(UCase(m_zymc.Text)) & " '", 4)
LS_REC1.MoveLast
m_zydm.Text = LS_REC1!ZYDM
m_zydw.Text = LS_REC1!ZYDW
m_dj.Text = LS_REC1!DJ
m_zydm.Enabled = False
m_zydw.Enabled = False
m_dj.Enabled = False
m_qsrq.SetFocus
End If
End If
End Sub
Private Sub m_zysl_Change()
If Not frm_msg.Caption = "" Then
frm_msg.Caption = ""
End If
End Sub
Private Sub m_zysl_GotFocus()
m_zysl.SelStart = 0
m_zysl.SelLength = Len(Trim(m_zysl.Text))
End Sub
Private Sub m_zysl_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_zysl_LostFocus
End If
End Sub
Private Sub m_zysl_LostFocus()
If Frame2.Enabled = True Then
If IsNumeric(Trim(m_zysl.Text)) Then
If Not CDec(Trim(m_zysl.Text)) < 1 Then
m_hjje.Text = CStr(CDec(Trim(m_dj.Text)) * CDec(Trim(m_zysl.Text)))
CMD1(0).SetFocus
Else
frm_msg.Caption = "无效数量"
m_zysl.SetFocus
m_zysl.SelStart = 0
m_zysl.SelLength = Len(Trim(m_zysl.Text))
End If
Else
frm_msg.Caption = "无效数量"
m_zysl.SetFocus
m_zysl.SelStart = 0
m_zysl.SelLength = Len(Trim(m_zysl.Text))
End If
End If
End Sub
Private Sub Timer1_Timer()
JZ_DQSJ2 = Time()
End Sub
Private Sub FLEX1_GotFocus()
On Error GoTo error1
m_zydm.Text = Trim(flex1.TextArray(flex1.Row * 9))
m_zymc.Text = Trim(flex1.TextArray(flex1.Row * 9 + 1))
m_qsrq.Text = IIf(Trim(flex1.TextArray(flex1.Row * 9 + 2)) = "", " - - ", Format(flex1.TextArray(flex1.Row * 9 + 2), "yyyy-mm-dd"))
m_jzrq.Text = IIf(Trim(flex1.TextArray(flex1.Row * 9 + 3)) = "", " - - ", Format(flex1.TextArray(flex1.Row * 9 + 3), "yyyy-mm-dd"))
m_zydw.Text = Trim(flex1.TextArray(flex1.Row * 9 + 4))
m_dj.Text = Trim(flex1.TextArray(flex1.Row * 9 + 5))
m_zysl.Text = Trim(flex1.TextArray(flex1.Row * 9 + 6))
m_hjje.Text = Trim(flex1.TextArray(flex1.Row * 9 + 7))
m_lsh.Text = Trim(flex1.TextArray(flex1.Row * 9 + 8))
Exit Sub
error1:
If Err() = 383 Then
Resume Next
End If
End Sub
Private Sub FLEX1_RowColChange()
On Error GoTo error1
m_zydm.Text = Trim(flex1.TextArray(flex1.Row * 9))
m_zymc.Text = Trim(flex1.TextArray(flex1.Row * 9 + 1))
m_qsrq.Text = IIf(Trim(flex1.TextArray(flex1.Row * 9 + 2)) = "", " - - ", Format(flex1.TextArray(flex1.Row * 9 + 2), "yyyy-mm-dd"))
m_jzrq.Text = IIf(Trim(flex1.TextArray(flex1.Row * 9 + 3)) = "", " - - ", Format(flex1.TextArray(flex1.Row * 9 + 3), "yyyy-mm-dd"))
m_zydw.Text = Trim(flex1.TextArray(flex1.Row * 9 + 4))
m_dj.Text = Trim(flex1.TextArray(flex1.Row * 9 + 5))
m_zysl.Text = Trim(flex1.TextArray(flex1.Row * 9 + 6))
m_hjje.Text = Trim(flex1.TextArray(flex1.Row * 9 + 7))
m_lsh.Text = Trim(flex1.TextArray(flex1.Row * 9 + 8))
Exit Sub
error1:
If Err() = 383 Then
Resume Next
End If
End Sub
'初始化
Private Sub first()
Frame2.Enabled = False
m_zydm.Enabled = True
m_zymc.Enabled = True
m_zysl.Enabled = True
m_qsrq.Enabled = True
m_jzrq.Enabled = True
m_dj.Enabled = True
m_zydw.Enabled = True
m_hjje.Enabled = True
CMD1(0).Enabled = True
CMD1(1).Enabled = True
If Cmd2(0).Enabled = False And hz_mx <> "0" Then
Cmd2(0).Enabled = True
End If
If Cmd2(1).Enabled = False And hz_mx <> "0" Then
Cmd2(1).Enabled = True
End If
If Cmd2(2).Enabled = False Then
Cmd2(2).Enabled = True
End If
If Cmd2(3).Enabled = False Then
Cmd2(3).Enabled = True
End If
If Cmd3.Enabled = False Then
Cmd3.Enabled = True
End If
If FLEX2.Visible = True And hz_mx <> "0" Then
FLEX2.Visible = False
End If
If flex1.Enabled = False Then
flex1.Enabled = True
flex1.SetFocus
End If
If flex1.Visible = False And hz_mx <> "0" Then
flex1.Visible = True
End If
If flex1.Rows = 1 Then
m_zydm.Text = ""
Cmd2(1).Enabled = False
Cmd2(2).Enabled = False
Else
If hz_mx <> "0" Then
Cmd2(1).Enabled = True
Cmd2(2).Enabled = True
End If
End If
pass = ""
nam.Caption = ""
End Sub
'租用建立
Private Sub zy_jl()
Frame2.Enabled = True
If flex1.Enabled = True Then
flex1.Enabled = False
End If
nam.Caption = "当前状态:物品租用建立"
Cmd2(0).Enabled = False
Cmd2(1).Enabled = False
Cmd2(2).Enabled = False
Cmd2(3).Enabled = False
Cmd3.Enabled = False
If m_zydm.Enabled = False Then
m_zydm.Enabled = True
m_zydm.SetFocus
m_zydm.Text = ""
Else
m_zydm.SetFocus
m_zydm.Text = ""
End If
End Sub
'租用删除
Private Sub zy_sc()
Cmd2(0).Enabled = False
Cmd2(1).Enabled = False
Cmd2(2).Enabled = False
Cmd2(3).Enabled = False
Cmd3.Enabled = False
m_zydm.Enabled = False
m_zymc.Enabled = False
m_zysl.Enabled = False
m_qsrq.Enabled = False
m_jzrq.Enabled = False
m_dj.Enabled = False
m_zydw.Enabled = False
m_hjje.Enabled = False
If Frame2.Enabled = False Then
Frame2.Enabled = True
CMD1(0).SetFocus
Else
CMD1(0).SetFocus
End If
End Sub
Private Sub ret()
m_zydm.Enabled = False
m_zymc.Enabled = False
m_qsrq.Enabled = False
m_jzrq.Enabled = False
m_zydw.Enabled = False
m_dj.Enabled = False
m_zysl.Enabled = False
m_hjje.Enabled = False
CMD1(0).Enabled = False
CMD1(1).Enabled = False
nam.Visible = False
If FLEX2.Visible = True Then
FLEX2.SetFocus
End If
End Sub
'汇总
Private Sub hz()
m_qsrq.Visible = False
m_jzrq.Visible = False
m_zydw.Visible = False
m_dj.Visible = False
m_zysl.Visible = False
m_hjje.Visible = False
Label2.Visible = False
Label6.Visible = False
Label7.Visible = False
Label8.Visible = False
Label9.Visible = False
lbl.Visible = False
Label3.Visible = True
Label10.Visible = True
Label11.Visible = True
m_zydw1.Visible = True
m_zysl1.Visible = True
m_hjje1.Visible = True
End Sub
'显示明细
Private Sub xsmx()
m_qsrq.Visible = True
m_jzrq.Visible = True
m_zydw.Visible = True
m_dj.Visible = True
m_zysl.Visible = True
m_hjje.Visible = True
Label2.Visible = True
Label6.Visible = True
Label7.Visible = True
Label8.Visible = True
Label9.Visible = True
lbl.Visible = True
Label3.Visible = False
Label10.Visible = False
Label11.Visible = False
m_zydw1.Visible = False
m_zysl1.Visible = False
m_hjje1.Visible = False
End Sub
Private Sub flex_ref()
If hz_mx <> "0" Then '非汇总
Set t_rec = YX_data.OpenRecordset("select HY_DDH,ZYDM,ZYMC,QSRQ,JZRQ,ZYDW,DJ,ZYSL,HJJE,LSH,LOCK_NO from HY_YDMX where HY_DDH='" & yx_hyyd.hy_dh & " '", 4)
If Not t_rec.BOF Then
t_rec.MoveLast
End If
Call pub_memo.Flex_full(flex1, t_bt, t_rec, t_fields, 8, Array(0, 0, 0, 0, 0, 0, 0, 0, 0))
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
Else
Set t_rec = YX_data.OpenRecordset("select HY_DDH,ZYDM,ZYMC,ZYDW,ZYSL,HJJE,LOCK_NO from HY_ZYMX_HZ ", 4)
If Not t_rec.BOF Then
t_rec.MoveLast
End If
t_fields1 = Array(1, 2, 3, 4, 5)
t_bt1 = "^ 租用资源代码 |^ 租用资源名称 |^ 计量单位 |^ 数量 |^ 合计金额 "
If FLEX2.Visible = False And flex1.Visible = True Then
FLEX2.Visible = True
flex1.Visible = False
End If
Call pub_memo.Flex_full(FLEX2, t_bt1, t_rec, t_fields1, 4, Array(0, 0, 0, 0, 0))
rec_no.Caption = "当前记录数:" + CStr(FLEX2.Rows - 1)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -