📄 dlgrydr.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form dlgRYDR
BackColor = &H80000018&
BorderStyle = 1 'Fixed Single
Caption = "团体人员导入"
ClientHeight = 6420
ClientLeft = 45
ClientTop = 330
ClientWidth = 7665
Icon = "dlgRYDR.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6420
ScaleWidth = 7665
StartUpPosition = 2 'CenterScreen
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3600
Top = 2970
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
BackColor = &H80000018&
Caption = "选择单位"
Height = 5175
Left = 90
TabIndex = 0
Top = 150
Width = 7455
Begin MSComctlLib.ListView lvwDW
DragIcon = "dlgRYDR.frx":0CCA
Height = 4905
Left = 60
TabIndex = 1
Top = 210
Width = 7320
_ExtentX = 12912
_ExtentY = 8652
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
OLEDragMode = 1
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = 16777152
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
OLEDragMode = 1
NumItems = 2
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "单位名称"
Object.Width = 10583
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "体检日期"
Object.Width = 2646
EndProperty
End
End
Begin XPControls.XPCommandButton cmdSelectFile
Height = 435
Left = 1140
TabIndex = 2
Top = 5820
Width = 1155
_ExtentX = 2037
_ExtentY = 767
Caption = "选择文件(&S)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdOK
Height = 435
Left = 3090
TabIndex = 3
Top = 5820
Width = 1155
_ExtentX = 2037
_ExtentY = 767
Enabled = 0 'False
Caption = "确定(&A)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPControls.XPCommandButton cmdExit
Height = 435
Left = 5160
TabIndex = 4
Top = 5820
Width = 1155
_ExtentX = 2037
_ExtentY = 767
Caption = "退出(&X)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Frame Frame2
BackColor = &H80000018&
Caption = "选择体检日期"
Height = 765
Left = 120
TabIndex = 5
Top = 4470
Visible = 0 'False
Width = 7455
Begin MSComCtl2.DTPicker dtpTJRQ
Height = 345
Left = 120
TabIndex = 6
Top = 270
Width = 3105
_ExtentX = 5477
_ExtentY = 609
_Version = 393216
Format = 55443457
UpDown = -1 'True
CurrentDate = 38123
MaxDate = 73415
MinDate = 36526
End
End
Begin VB.Label LblFileName
BackStyle = 0 'Transparent
Caption = "所选的文件名"
Height = 315
Left = 150
TabIndex = 7
Top = 5490
Width = 7365
End
End
Attribute VB_Name = "dlgRYDR"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strFileName As String
Dim strDWID As String
Dim strYYID As String
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim strSQL As String
Dim rsTemp As ADODB.Recordset
'是否选择了文件
If strFileName = "" Then
MsgBox "您尚未选择文件。请首先选择含有导入名单的Excel文件!", vbInformation, "提示"
Exit Sub
End If
'首先检查该单位是否已建立了分组,如没有则提示建立
Set rsTemp = New ADODB.Recordset
strSQL = "select * from FZ_FZSY where YYID='" & lvwDW.SelectedItem.Key & "' order by FZID"
rsTemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
If rsTemp.RecordCount = 0 Then
MsgBox "该单位尚未建立分组,不能进行数据导入,请先建立分组", , "提示"
Exit Sub
Else
rsTemp.MoveFirst
End If
'根据strFileName导入人员
Me.MousePointer = 11
ImportFromExcel strFileName, strYYID, rsTemp("FZTJRQ")
Me.MousePointer = 0
MsgBox "导入完毕", , "成功"
cmdOK.Enabled = False
End Sub
Private Sub cmdSelectFile_Click()
On Error GoTo ErrMsg
Dim Status
Dim strSQL As String
Dim strExport As String
Dim rsTemp As ADODB.Recordset
strFileName = GetFileName(Me.CommonDialog1, "Excel文件(*.xls)|*.xls", _
"请设置导出文件名", "人员清单.xls", READFILE)
If strFileName = "" Then GoTo ExitLab
LblFileName.Caption = "您所选择的文件为: " & strFileName
cmdOK.Enabled = True
cmdSelectFile.Enabled = False
GoTo ExitLab
ErrMsg:
Status = SetError(Err.Number, Err.Description, "MDIForm1.SetBackground")
ErrMsg Status
ExitLab:
End Sub
Private Sub Form_Load()
Dim strSQL As String
Dim rsTemp As ADODB.Recordset
Dim itemX As ListItem
LblFileName.Caption = ""
cmdOK.Enabled = False
strSQL = "select YYID,SET_DW.DWID,DWMC,TJRQ" _
& " from YY_TJDJ,SET_DW" _
& " where YY_TJDJ.DWID=SET_DW.DWID" _
& " order by TJRQ"
Set rsTemp = New ADODB.Recordset
rsTemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
If rsTemp.RecordCount > 0 Then
rsTemp.MoveFirst
Do While Not rsTemp.EOF
Set itemX = lvwDW.ListItems.Add(, rsTemp("YYID"), rsTemp("DWMC"))
itemX.SubItems(1) = rsTemp("TJRQ")
rsTemp.MoveNext
Loop
lvwDW.ListItems(1).Selected = True
strYYID = lvwDW.ListItems(1).Key
rsTemp.MoveFirst
dtpTJRQ.Value = rsTemp("TJRQ")
End If
End Sub
Private Sub lvwDW_Click()
Dim rsTemp As ADODB.Recordset
Dim strSQL As String
If lvwDW.ListItems.Count = 0 Then
Exit Sub
End If
Set rsTemp = New ADODB.Recordset
strYYID = lvwDW.SelectedItem.Key
cmdOK.Enabled = False
strSQL = "select * from YY_TJDJ where YYID='" & strYYID & "'"
rsTemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
dtpTJRQ.Value = rsTemp("TJRQ")
LblFileName.Caption = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -