📄 flfz.frm
字号:
VERSION 5.00
Begin VB.Form FlFz
Caption = "录入"
ClientHeight = 1620
ClientLeft = 60
ClientTop = 345
ClientWidth = 6045
ClipControls = 0 'False
Icon = "FlFz.frx":0000
LinkTopic = "Form1"
ScaleHeight = 1620
ScaleWidth = 6045
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 810
TabIndex = 3
Top = 240
Width = 1455
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 810
TabIndex = 2
Top = 840
Width = 3255
End
Begin VB.CommandButton Command1
Caption = "保存"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4485
TabIndex = 1
Top = 210
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4485
TabIndex = 0
Top = 810
Width = 1215
End
Begin VB.Label Label1
BackColor = &H80000004&
Caption = "编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 210
TabIndex = 5
Top = 240
Width = 465
End
Begin VB.Label Label2
BackColor = &H80000004&
Caption = "名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 210
TabIndex = 4
Top = 840
Width = 855
End
End
Attribute VB_Name = "FlFz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myclass As New Flclass
Dim strTable1 As String
Dim strTable2 As String
Public Flag As Integer '状态标志为1是增加2是修改0为还原
Private Sub Command1_Click()
On Error GoTo err:
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Then
MsgBox "内容不能为空", vbInformation
Exit Sub
End If
If Flag = 1 Then
If myclass.PassTest(Text1.Text) Then
If myclass.PassData(Text1.Text) Then
Call myclass.AddRow(Text1, Text2)
Call textclear
Unload Me
End If
End If
End If
If Flag = 2 Then
Call myclass.UpdataData(Text1.Text, Text2.Text)
Unload Me
End If
Exit Sub
err:
MsgBox err.Description, vbInformation, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Sub textclear()
Text1.Text = ""
Text2.Text = ""
End Sub
Sub gettablename(ByVal str1 As String, ByVal str2 As String, ByVal int1 As String)
strTable1 = str1
strTable2 = str2
Flag = int1
End Sub
Sub getdata(ByVal str1 As String, ByVal str2 As String)
Text1.Text = str1
Text1.Locked = True
Text2.Text = str2
End Sub
Private Sub Form_Load()
If FlMain.strtable = "GyzcCode" Then
Call myclass.Tablename("Gyzc", "GyzcCode")
Call myclass.GetCodeMode
End If
If FlMain.strtable = "DwBmCode" Then
Call myclass.Tablename("DwBm", "DwBmCode")
Call myclass.GetCodeMode
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii >= 48 And KeyAscii <= 58) Or KeyAscii = 13 Then
If KeyAscii = 13 Then
Text2.SetFocus
End If
Else
KeyAscii = 0
MsgBox "只能是数字", vbOKOnly + vbInformation, "提示"
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -