📄 frmsal.frm
字号:
End With
vasent.Enabled = False
frminput.Enabled = True
txtentc.Enabled = False
cmbcode.SetFocus
Case "modify"
With UserControl1
.DisplayButton "New", "New", False, , "New"
.DisplayButton "Delete", "Delete", False, , "Delete"
'.DisplayButton "Print", "Print", False, , "Print"
.DisplayButton "Modify", "Modify", False, , "Modify"
.DisplayButton "Save", "Save", True, , "Save"
.DisplayButton "Cancel", "Cancel", True, , "Cancel"
'.DisplayButton "Redo", "Redo", True, , "Redo"
.DisplayButton "Close", "Close", False, , "Close"
'Call ChangeColor(vasent, vasent.ActiveRow, -1)
End With
vasent.Enabled = False
frminput.Enabled = True
txtentc.Enabled = False
cmbyear.Enabled = False
cmbcode.Enabled = False
txtp1.SetFocus
Case "cancel"
With UserControl1
.DisplayButton "New", "New", True, , "New"
.DisplayButton "Delete", "Delete", True, , "Delete"
'.DisplayButton "Find", "Find", True, , "Find"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Modify", "Modify", True, , "Modify"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Cancel", "Cancel", False, , "Cancel"
'.DisplayButton "Redo", "Redo", False, , "Redo"
.DisplayButton "Close", "Close", True, , "Close"
End With
vasent.Enabled = True
cmbyear.Enabled = True
cmbcode.Enabled = True
frminput.Enabled = False
lblstatus.Caption = "'"
Call vasent_Click(lCurCol, lCurRow)
Case "save"
With UserControl1
.DisplayButton "New", "New", True, , "New"
.DisplayButton "Delete", "Delete", True, , "Delete"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Modify", "Modify", True, , "Modify"
.DisplayButton "Cancel", "Cancel", False, , "Cancel"
'.DisplayButton "Redo", "Redo", False, , "Redo"
.DisplayButton "Close", "Close", True, , "Close"
End With
vasent.Enabled = True
cmbyear.Enabled = True
cmbcode.Enabled = True
frminput.Enabled = False
Case "delete"
With UserControl1
.DisplayButton "New", "New", True, , "New"
.DisplayButton "Delete", "Delete", True, , "Delete"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Modify", "Modify", True, , "Modify"
.DisplayButton "Cancel", "Cancel", False, , "Cancel"
'.DisplayButton "Redo", "Redo", False, , "Redo"
.DisplayButton "Close", "Close", True, , "Close"
End With
vasent.Enabled = True
frminput.Enabled = False
Call vasshow
End Select
Call EnableDelete(gsRoleCode, UserControl1)
End Sub
Private Sub txtisnumeric(txtthis As TextBox, txtprev As TextBox)
If txtthis.Text = "" Then
txtthis.Text = "0"
ElseIf IsNumeric(txtthis.Text) Then
SendKeys "{tab}"
Else
MsgBox "The input must be numeric!"
txtprev.SetFocus
End If
End Sub
Private Sub txtp1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp1_LostFocus()
If txtp1.Text = "" Then
txtp1.Text = "0"
ElseIf IsNumeric(txtp1.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp1.SetFocus
End If
End Sub
Private Sub txtp2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp2_LostFocus()
If txtp2.Text = "" Then
txtp2.Text = "0"
ElseIf IsNumeric(txtp2.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp3.SetFocus
End If
End Sub
Private Sub txtp3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp3_LostFocus()
If txtp3.Text = "" Then
txtp3.Text = "0"
ElseIf IsNumeric(txtp3.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp3.SetFocus
End If
End Sub
Private Sub txtp4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp4_LostFocus()
If txtp4.Text = "" Then
txtp4.Text = "0"
ElseIf IsNumeric(txtp4.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp4.SetFocus
End If
End Sub
Private Sub txtp5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp5_LostFocus()
If txtp5.Text = "" Then
txtp5.Text = "0"
ElseIf IsNumeric(txtp5.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp5.SetFocus
End If
End Sub
Private Sub txtp6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp6_LostFocus()
If txtp6.Text = "" Then
txtp6.Text = "0"
ElseIf IsNumeric(txtp6.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp6.SetFocus
End If
End Sub
Private Sub txtp7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp7_LostFocus()
If txtp7.Text = "" Then
txtp7.Text = "0"
ElseIf IsNumeric(txtp7.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp7.SetFocus
End If
End Sub
Private Sub txtp8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp8_LostFocus()
If txtp8.Text = "" Then
txtp8.Text = "0"
ElseIf IsNumeric(txtp8.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp8.SetFocus
End If
End Sub
Private Sub txtp9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp9_LostFocus()
If txtp9.Text = "" Then
txtp9.Text = "0"
ElseIf IsNumeric(txtp9.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp9.SetFocus
End If
End Sub
Private Sub txtp10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp10_LostFocus()
If txtp10.Text = "" Then
txtp10.Text = "0"
ElseIf IsNumeric(txtp10.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp10.SetFocus
End If
End Sub
Private Sub txtp11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp11_LostFocus()
If txtp11.Text = "" Then
txtp11.Text = "0"
ElseIf IsNumeric(txtp11.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp11.SetFocus
End If
End Sub
Private Sub txtp12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
SendKeys "{tab}"
End If
End Sub
Private Sub txtp12_LostFocus()
If txtp12.Text = "" Then
txtp12.Text = "0"
ElseIf IsNumeric(txtp12.Text) Then
Else
MsgBox "The input must be numeric!", vbOKOnly, "Information"
txtp12.SetFocus
End If
End Sub
Private Sub cmbcode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If cmbcode.Text = "" Then
Else
SendKeys "{tab}"
End If
End If
End Sub
Private Sub cmbyear_KeyUp(KeyCode As Integer, Shift As Integer)
Dim year As Integer
Dim syear As String
syear = str(Now)
syear = LTrim(syear)
syear = Left(syear, 4)
year = CInt(syear)
If KeyCode = vbKeyReturn Then
If cmbyear.Text = "" Then
ElseIf IsNumeric(cmbyear.Text) Then
If CInt(cmbyear.Text) = year Or CInt(cmbyear.Text) = year + 1 Then
SendKeys "{tab}"
Else
MsgBox "Only the current year and next year are available!"
cmbcode.SetFocus
End If
End If
End If
End Sub
Private Sub UserControl1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
mkey = LCase(Button.Key)
Select Case LCase(Button.Key)
Case "new"
lblstatus.Caption = mkey
Call spreaddetail
Case "save"
If lblstatus.Caption = "new" Then
If saveinfo = False Then
Exit Sub
End If
ElseIf lblstatus.Caption = "modify" Then
If ModifyInfo = False Then
Exit Sub
End If
End If
Call vasshow
Case "find"
lblstatus.Caption = "search"
Case "modify"
lblstatus.Caption = mkey
Case "delete"
If MsgBox("Are you sure to delete this record?", vbYesNo, "Message") = vbYes Then
Call DelRecord
Call vasshow
Else
Exit Sub
End If
Case "close"
Unload Me
Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -