📄 frm_fixlistmod.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frm_fixlistMod
Caption = "Form1"
ClientHeight = 4455
ClientLeft = 4290
ClientTop = 3735
ClientWidth = 10575
LinkTopic = "Form1"
ScaleHeight = 4455
ScaleWidth = 10575
Begin VB.CommandButton btnClose
Caption = "关 闭"
Height = 495
Left = 8400
TabIndex = 2
Top = 3840
Width = 1215
End
Begin VB.CommandButton cmdAlter
Caption = "修 改"
Height = 495
Left = 7080
TabIndex = 1
Top = 3840
Width = 1215
End
Begin VB.TextBox txtID
Height = 375
Left = 3480
TabIndex = 0
Top = 3360
Width = 2895
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2535
Left = 0
TabIndex = 3
Top = 600
Width = 10575
_ExtentX = 18653
_ExtentY = 4471
_Version = 393216
End
Begin VB.Label Label1
Caption = "固定资产信息列表"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 5
Top = 120
Width = 2655
End
Begin VB.Label Label2
Caption = "请输入您要修改的资产编号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 4
Top = 3360
Width = 3135
End
End
Attribute VB_Name = "frm_fixlistMod"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rst As New ADODB.Recordset
Dim rstName As New ADODB.Recordset
Dim strSql, strSqlName As String
Public Sub ShowData()
Dim j As Integer
Dim i As Integer
strSql = "select zcID,zcName,zcNum,zcMoney,zcBy,zcMark from tb_zichan"
Set rst = ExecuteSql(strSql)
If rst.EOF = False Then
With MSFlexGrid1
.Rows = 1
Do While Not rst.EOF
.Rows = .Rows + 1
For i = 1 To rst.Fields.Count
Select Case rst.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i - 1) = Format(rst.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i - 1) = rst.Fields(i - 1) & ""
End Select
Next i
rst.MoveNext
Loop
End With
End If
rst.Close
End Sub
Private Sub btnClose_Click()
Me.Hide
End Sub
Private Sub cmdAlter_Click()
If Trim(txtID.Text) = "" Then
MsgBox "请输入您要修改的资产编号!"
txtID.SetFocus
Else
Dim strSql As String
Dim rst As New ADODB.Recordset
strSql = "select * from tb_zichan where zcID = '" & txtID.Text & "'"
Set rst = ExecuteSql(strSql)
If rst.EOF = True Then
MsgBox "此条记录不存在,请核对后重新输入!"
Else
Me.Hide
ModFixed.Show
End If
End If
End Sub
Private Sub Form_Load()
'txtID.Text = ""
With MSFlexGrid1
'固定表头
.FixedRows = 1
'表头项居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
.Rows = 2
.Cols = 6
End With
'guding liekuan
MSFlexGrid1.ColWidth(0) = 1200
MSFlexGrid1.ColWidth(1) = 1200
MSFlexGrid1.ColWidth(2) = 1500
MSFlexGrid1.ColWidth(3) = 2000
MSFlexGrid1.ColWidth(4) = 2000
MSFlexGrid1.ColWidth(5) = 2400
MSFlexGrid1.TextMatrix(0, 0) = "资产编号"
MSFlexGrid1.TextMatrix(0, 1) = "资产名称"
MSFlexGrid1.TextMatrix(0, 2) = "资产数目"
MSFlexGrid1.TextMatrix(0, 3) = "单价(元)"
MSFlexGrid1.TextMatrix(0, 4) = "经手人ID"
MSFlexGrid1.TextMatrix(0, 5) = "购买日期"
ShowData ''''
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -