📄 formzgrep.frm
字号:
BeginProperty Column03
ColumnWidth = 1920.189
EndProperty
BeginProperty Column04
ColumnWidth = 1289.764
EndProperty
BeginProperty Column05
ColumnWidth = 794.835
EndProperty
BeginProperty Column06
ColumnWidth = 1049.953
EndProperty
BeginProperty Column07
ColumnWidth = 1289.764
EndProperty
BeginProperty Column08
ColumnWidth = 1154.835
EndProperty
BeginProperty Column09
ColumnWidth = 1484.787
EndProperty
BeginProperty Column10
ColumnWidth = 1349.858
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adcbm
Height = 330
Left = 2880
Top = 1080
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "tbm"
Caption = "Adcbm"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc adczg
Height = 330
Left = 600
Top = 1080
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "tzg"
Caption = "Adczg"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label9
Caption = "--"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2880
TabIndex = 25
Top = 240
Width = 255
End
Begin VB.Label Label8
Caption = "记录"
Height = 255
Left = 2280
TabIndex = 23
Top = 5520
Width = 495
End
Begin VB.Label Label7
Caption = "合计"
Height = 255
Left = 480
TabIndex = 21
Top = 5520
Width = 495
End
Begin VB.Label Label5
Caption = "--"
Height = 255
Left = 6480
TabIndex = 18
Top = 600
Width = 255
End
Begin VB.Label Label1
Caption = "请输入工号"
Height = 255
Left = 720
TabIndex = 17
Top = 240
Width = 975
End
Begin VB.Label Label2
Caption = "姓名"
Height = 255
Left = 4800
TabIndex = 16
Top = 240
Width = 375
End
Begin VB.Label Label3
Caption = "部门"
Height = 255
Left = 2400
TabIndex = 15
Top = 600
Width = 375
End
Begin VB.Label Label4
Caption = "入厂日期"
Height = 255
Left = 4440
TabIndex = 14
Top = 600
Width = 735
End
Begin VB.Label Label6
Caption = "职务"
Height = 255
Left = 600
TabIndex = 13
Top = 600
Width = 495
End
End
Attribute VB_Name = "Formzgrep"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim vzgid, vzgname, vbmid, vdate1, vdate2, vjobid
Dim zgid, zgname, bmname, jobname, studyname, sexname, workdate, writedate, repdate
Dim address, borth, bmid, jobid, sexid, sfid, studyid
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Command1_Click()
Dialogbm7.Show
End Sub
Private Sub Command2_Click()
Dialogjob5.Show
End Sub
Private Sub Command3_Click()
End Sub
Private Sub Command4_Click()
Adczgrep.RecordSource = " select * from zgrep where zgid<>''"
Adczgrep.Refresh
Do While Not Adczgrep.Recordset.EOF
Adczgrep.Recordset.Delete
'Adczgrep.Recordset.update
Adczgrep.Recordset.MoveNext
If Adczgrep.Recordset.EOF Then
Exit Do
End If
Loop
End Sub
Private Sub Command5_Click()
End Sub
Private Sub Command6_Click()
CR1.Action = 0
End Sub
Private Sub Form_Load()
Adczgrep.RecordSource = "select * from zgrep where zgid<>'' order by zgid "
Adczgrep.Refresh
If Adczgrep.Recordset.EOF Then
Textcount.Text = 0
Else
Textcount.Text = Adczgrep.Recordset.RecordCount
End If
End Sub
Private Sub OKButton_Click()
Dim vzgid1
vzgid = Textzgid.Text
vzgid1 = Textzgid1.Text
vzgname = Textzgname.Text
vbmid = Textbmid.Text
vdate1 = Textdate1.Text
vdate2 = Textdate2.Text
vjobid = Textjobid.Text
Adczg.RecordSource = "select * from tzg where (zgid>= '" & vzgid & "'and zgid <='" & vzgid1 & "')or zgname='" & vzgname & "'or bmid='" & vbmid & "'or (workdate>='" & vdate1 & "' and workdate<='" & vdate2 & "') or jobid='" & vjobid & "'order by zgid "
Adczg.Refresh
If Adczg.Recordset.EOF Then
Textcount.Text = 0
Else
Textcount.Text = Adczg.Recordset.RecordCount
Do While Not Adczg.Recordset.EOF
'找到一个员工档案
zgid = ""
zgname = ""
bmid = ""
jobid = ""
sexid = ""
studyid = ""
If Not IsNull(Adczg.Recordset.Fields("bmid").Value) Then
bmid = Adczg.Recordset.Fields("bmid").Value
Adcbm1.RecordSource = "select * from tbm where bmid='" & bmid & "'"
Adcbm1.Refresh
If Not Adcbm1.Recordset.EOF Then
bmname = Adcbm1.Recordset.Fields("bmname").Value
End If
End If
If Not IsNull(Adczg.Recordset.Fields("jobid").Value) Then
jobid = Adczg.Recordset.Fields("jobid").Value
Adcjob1.RecordSource = "select * from tjob where jobid='" & jobid & "'"
Adcjob1.Refresh
If Not Adcjob1.Recordset.EOF Then
jobname = Adcjob1.Recordset.Fields("jobname").Value
End If
End If
If Not IsNull(Adczg.Recordset.Fields("sex").Value) Then
sexid = Adczg.Recordset.Fields("sex").Value
Adcsex1.RecordSource = "select * from tsex where sexid='" & sexid & "'"
Adcsex1.Refresh
If Not Adcsex1.Recordset.EOF Then
sexname = Adcsex1.Recordset.Fields("sexname").Value
End If
End If
If Not IsNull(Adczg.Recordset.Fields("studyid").Value) Then
studyid = Adczg.Recordset.Fields("studyid").Value
Adcstudy1.RecordSource = "select * from tstudy where studyid='" & studyid & "'"
Adcstudy1.Refresh
If Not Adcstudy1.Recordset.EOF Then
studyname = Adcstudy1.Recordset.Fields("studyname").Value
End If
End If
Adczgrep.RecordSource = "select * from zgrep where zgid='" & zgid & "'"
Adczgrep.Refresh
'向zgrep表插入值
If Adczgrep.Recordset.EOF Then
Adczgrep.Recordset.AddNew
Adczgrep.Recordset.Fields("zgid").Value = Adczg.Recordset.Fields("zgid").Value
Adczgrep.Recordset.Fields("zgname").Value = Adczg.Recordset.Fields("zgname").Value
Adczgrep.Recordset.Fields("bmname").Value = bmname
Adczgrep.Recordset.Fields("jobname").Value = jobname
Adczgrep.Recordset.Fields("sexname").Value = sexname
Adczgrep.Recordset.Fields("workdate").Value = Adczg.Recordset.Fields("workdate").Value
Adczgrep.Recordset.Fields("writedate").Value = Adczg.Recordset.Fields("writedate").Value
Adczgrep.Recordset.Fields("borth").Value = Adczg.Recordset.Fields("borth").Value
Adczgrep.Recordset.Fields("sfid").Value = Adczg.Recordset.Fields("sfid").Value
Adczgrep.Recordset.Fields("address").Value = Adczg.Recordset.Fields("jaddress").Value
Adczgrep.Recordset.Fields("studyname").Value = studyname
Adczgrep.Recordset.Fields("repdate").Value = Date
Adczgrep.Recordset.update
End If
Adczg.Recordset.MoveNext
Loop
End If
Adczgrep.RecordSource = "select * from zgrep where zgid<>'' order by zgid "
Adczgrep.Refresh
If Adczgrep.Recordset.EOF Then
Textcount.Text = 0
Else
Textcount.Text = Adczgrep.Recordset.RecordCount
End If
End Sub
Private Sub Textzgid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textzgid1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -