📄 backup1.txt
字号:
Private Sub Command3_Click()
txtCode.Text = ""
txtName.Text = ""
txtCouse.Text = ""
txtAdd.Text = ""
txtTel.Text = ""
txtCode.Enabled = True
End Sub
Private Sub Command4_Click()
Dim i As Long
With fg
' .Rows = 1
' .Cols = 5
' .FixedCols = 0
' .TextMatrix(0, 0) = "No"
' .TextMatrix(0, 1) = "Name"
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "select HIKITORISAKI_CD,HIKITORISAKI_NM,HIKITORI_COUSE,ADDR,TEL from T_MHIKITORISAKI where HIKITORISAKI_CD like " & Trim(Val(txtCode.Text)) & " or HIKITORISAKI_NM like '" & Trim(txtName.Text) & "' or HIKITORI_COUSE like " & Trim(Val(txtCouse.Text)) & " or ADDR like '" & Trim(txtAdd.Text) & "' or TEL like '" & Trim(txtTel.Text) & "'", dbConn
i = 0
Do While Not rs.EOF
i = i + 1
.Rows = .Rows + 1
.TextMatrix(i, 0) = rs.Fields(0) 'HIKITORISAKI_CD
.TextMatrix(i, 1) = rs.Fields(1) 'HIKITORISAKI_NM
.TextMatrix(i, 2) = rs.Fields(2) 'HIKITORI_COUSE
.TextMatrix(i, 3) = rs.Fields(3) 'ADDR
.TextMatrix(i, 4) = rs.Fields(4) 'TEL
' .Cell(flexcpText, i, 0, i, 0) = CStr(rs.Fields(0)) 'sno
' .Cell(flexcpText, i, 1, i, 1) = rs.Fields(1) 'sname
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End With
End Sub
Private Sub Command5_Click()
If txtCode.Enabled = True Then
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "insert into T_MHIKITORISAKI (HIKITORISAKI_CD,HIKITORISAKI_NM,HIKITORI_COUSE,ADDR,TEL) values (" & Trim(txtCode.Text) & "," & Trim(txtName.Text) & "," & Trim(txtCouse.Text) & "," & Trim(txtAdd.Text) & "," & Trim(txtTel.Text) & ")"
End Sub
Private Sub txtAdd_KeyPress(KeyAscii As Integer)
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
If Len(txtCode.Text) >= 100 Then
KeyAscii = 0
End If
If InStr(Chr(KeyAscii), "'") Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtCode_KeyPress(KeyAscii As Integer)
Dim strValid As String
strValid = "0123456789"
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
If KeyAscii > 26 Then
If InStr(strValid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If Len(txtCode.Text) >= 5 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtCouse_KeyPress(KeyAscii As Integer)
Dim strValid As String
strValid = "0123456789"
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
If KeyAscii > 26 Then
If InStr(strValid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If Len(txtCouse.Text) >= 5 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtName_KeyPress(KeyAscii As Integer)
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
If Len(txtName.Text) >= 100 Then
KeyAscii = 0
End If
If InStr(Chr(KeyAscii), "'") Then
KeyAscii = 0
End If
End If
End Sub
Private Sub txtTel_KeyPress(KeyAscii As Integer)
Dim strValid As String
strValid = "0123456789-"
If (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) Then
If KeyAscii > 26 Then
If InStr(strValid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If Len(txtTel.Text) >= 20 Then
KeyAscii = 0
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -