📄 main_rsgl_rsdaxx.frm
字号:
BeginProperty Column04
ColumnWidth = 840.189
EndProperty
BeginProperty Column05
ColumnWidth = 1140.095
EndProperty
BeginProperty Column06
ColumnWidth = 764.787
EndProperty
BeginProperty Column07
ColumnWidth = 569.764
EndProperty
BeginProperty Column08
ColumnWidth = 810.142
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 2550
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 12
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":0021
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":08FB
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":11D5
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":1AAF
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":2789
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":3063
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":37DD
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":44B7
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":4D91
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":578B
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":6465
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_rsdaxx.frx":7ABF
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 795
Left = 0
TabIndex = 1
Top = 0
Width = 7320
_ExtentX = 12912
_ExtentY = 1402
ButtonWidth = 1138
ButtonHeight = 1349
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 8
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 增加 "
Key = "add"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "modify"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "delete"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查找"
Key = "find"
ImageIndex = 6
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "输出"
Key = "excel"
ImageIndex = 9
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "close"
ImageIndex = 8
EndProperty
EndProperty
BorderStyle = 1
End
End
Attribute VB_Name = "main_rsgl_rsdaxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Form_Activate()
If sql1 <> "" Then
Adodc1.RecordSource = "select * from " & sql1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Else
MsgBox "没有找到符合条件的记录!", , "提示窗口"
End If
End If
End Sub
Private Sub Form_Load()
Me.Caption = text
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sql1 = ""
End Sub
Private Sub DataGrid1_DblClick()
If Adodc1.Recordset.RecordCount > 0 Then
blnAddRS = False
Load main_rsgl_rsdaxx_lr
main_rsgl_rsdaxx_lr.Show 1
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
blnAddRS = True
Load main_rsgl_rsdaxx_lr
main_rsgl_rsdaxx_lr.Show 1
Case "modify"
If Adodc1.Recordset.RecordCount > 0 Then
blnAddRS = False
Load main_rsgl_rsdaxx_lr
main_rsgl_rsdaxx_lr.Show 1
Else
MsgBox "系统没有要修改的数据!", , "提示窗口"
End If
Case "delete"
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
MsgBox "系统没有要删除的数据!", , "提示窗口"
End If
Case "find"
tb1 = "人事表"
Load main_fzfind
main_fzfind.Show 1
Case "all"
Adodc1.RecordSource = "select * from 人事表 order by 编号"
Adodc1.Refresh
Case "excel"
Dim r As Integer, c As Integer
Dim newxls As Excel.Application
Dim newbook As Excel.Workbook
Dim newsheet As Excel.Worksheet
Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
Set newbook = newxls.Workbooks.Add '创建工作簿
Set newsheet = newbook.Worksheets(1) '创建工作表
If sql1 <> "" Then
Adodc1.RecordSource = "select * from " & sql1
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from 人事表 order by 编号"
Adodc1.Refresh
End If
If Adodc1.Recordset.RecordCount > 0 Then
newxls.Visible = True
For i = 0 To DataGrid1.Columns.Count - 1
newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
Next i
'指定表格内容
Adodc1.Recordset.MoveFirst
Do Until Adodc1.Recordset.EOF
r = Adodc1.Recordset.AbsolutePosition
For c = 0 To DataGrid1.Columns.Count - 1
newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
Next c
Adodc1.Recordset.MoveNext
Loop
End If
Case "close"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -