📄 frminput.frm
字号:
VERSION 5.00
Begin VB.Form frminput
BorderStyle = 4 'Fixed ToolWindow
Caption = "值班记录"
ClientHeight = 4080
ClientLeft = 45
ClientTop = 285
ClientWidth = 5520
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4080
ScaleWidth = 5520
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame2
Height = 2415
Left = 0
TabIndex = 9
Top = 1080
Width = 5415
Begin VB.TextBox txtMemo
Appearance = 0 'Flat
Height = 2235
Left = 120
MaxLength = 30000
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 10
Top = 120
Width = 5175
End
End
Begin VB.Frame Frame1
Height = 1095
Left = 0
TabIndex = 2
Top = 0
Width = 5415
Begin VB.TextBox txtDate
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Height = 315
Left = 690
MaxLength = 10
TabIndex = 3
Top = 240
Width = 2070
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "输入字数"
Height = 180
Left = 120
TabIndex = 8
Top = 720
Width = 720
End
Begin VB.Label lblDate
AutoSize = -1 'True
Caption = "日期:"
Height = 180
Left = 120
TabIndex = 7
Top = 300
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "日期格式:2001-09-27"
Height = 180
Left = 3000
TabIndex = 6
Top = 315
Width = 1710
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "注:每篇日记不超过1000个字"
ForeColor = &H000000FF&
Height = 180
Left = 3000
TabIndex = 5
Top = 720
Width = 2250
End
Begin VB.Label lblNum
AutoSize = -1 'True
Caption = "0"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 210
Left = 1200
TabIndex = 4
Top = 705
Width = 105
End
End
Begin VB.CommandButton cmdSave
Caption = "保存 "
Height = 390
Left = 3120
TabIndex = 1
Top = 3600
Width = 855
End
Begin VB.CommandButton cmdReturn
Cancel = -1 'True
Caption = "返回"
Height = 390
Left = 4200
TabIndex = 0
Top = 3600
Width = 735
End
End
Attribute VB_Name = "frminput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdReturn_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
On Error Resume Next
Dim bSaved As Boolean, bCF
If txtDate = "" Or txtMemo = "" Then Exit Sub ' 如果记录未填,则退出
If riji.Tag = "addnew" Then
If giRecordCount >= 1 Then '新增时,检查记录是否重复
gsSql = frminput.txtDate
bCF = FindData(gsSql)
If bCF Then
MsgBox "今天你已经写过日记了!", vbExclamation + vbOKOnly, "每日一记"
txtMemo.SetFocus
Exit Sub
End If
End If
giRecordCount = giRecordCount + 1
bSaved = WriteData()
ElseIf riji.Tag = "modify" Then '
bSaved = ModifyData()
End If
If bSaved = True Then
AddNext = MsgBox("保存完毕!", vbExclamation + vbOKOnly, "每日一记")
End If
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim strTmp As String
Select Case riji.Tag
Case "addnew"
txtDate = Format(Date, "YYYY-MM-dd")
Exit Sub
Case Else
strTmp = goDiarys(giCurrentRecord).fldMemo
txtDate = goDiarys(giCurrentRecord).fldDate
txtDate.Enabled = False
strTmp = Trim(strTmp)
txtMemo = strTmp
End Select
End Sub
Private Sub txtDate_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Then
ElseIf KeyAscii = 8 Then
ElseIf KeyAscii = Asc("-") Then
Else
KeyAscii = 0
End If
End Sub
Private Sub txtMemo_Change()
lblNum.Caption = Len(Me.txtMemo) & "字"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -