📄 frmjjbb.frm
字号:
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc2
Height = 495
Left = 240
Top = 3360
Visible = 0 'False
Width = 5055
_ExtentX = 8916
_ExtentY = 873
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
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
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmjjbb.frx":0015
Height = 2895
Left = 120
TabIndex = 0
Top = 4200
Width = 11415
_ExtentX = 20135
_ExtentY = 5106
_Version = 393216
AllowUpdate = -1 'True
BackColor = 12648384
ForeColor = 4194304
HeadLines = 1
RowHeight = 18
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 6360
Width = 5175
_ExtentX = 9128
_ExtentY = 661
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
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
End
Attribute VB_Name = "frmjjbb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sql1 As String
Dim sql2 As String
Dim jjbjlxh As Integer
Dim hisjllx As String
Dim RS As ADODB.Recordset
Dim j As Integer
Private Sub Check1_Click()
If Check1.Value Then
Adodc1.RecordSource = "select * from xdgl_jjbfb where jbrq='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and jbbc='" & Trim(Combo2.Text) & "' order by jllx,jlxh"
Else
Adodc1.RecordSource = "select * from xdgl_jjbfb where jbrq='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and jbbc='" & Trim(Combo2.Text) & "' and jllx='" & Trim(Combo1.Text) & "' order by jllx,jlxh"
End If
Adodc1.Refresh
Call sx
End Sub
Private Sub Combo1_Click()
Call Check1_Click
End Sub
Private Sub Combo2_Click()
Call Check1_Click
End Sub
Private Sub Combo3_Change()
Adodc2.ConnectionString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
If Option1.Value Then
Adodc2.RecordSource = "select * from xdgl_zbjlb where dlsj='" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and zbbc='" & Trim(Combo3.Text) & "'"
Adodc2.Refresh
DataGrid2.Refresh
Call sx1
Else
Adodc2.RecordSource = "select * from xdgl_jjbfb where jbrq='" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and jbbc='" & Trim(Combo3.Text) & "'"
Adodc2.Refresh
DataGrid2.Refresh
Call sx2
End If
End Sub
Private Sub Combo3_Click()
Call Option1_Click
End Sub
Private Sub command1_Click()
If Trim(Text3.Text) = "" Then
A = MsgBox("是否添加一条空记录?", vbOKOnly)
Exit Sub
End If
If Trim(Combo1.Text) = "" Then
A = MsgBox("值班记录类型为空,请选择对应类型后录入!", vbOKOnly)
Exit Sub
End If
sql1 = "select max(id) from xdgl_jjbfb"
Call Open_link
Set RS = ZHCX.Execute(sql1, 0)
If Not IsNull(RS(0)) Then
ID = RS(0) + 1
Else
ID = 1
End If
If RS.State Then
RS.Close
End If
sql2 = "select max(jlxh) from xdgl_jjbfb where jbrq='" & Format(Now, "yyyy-mm-dd") & "' and jbbc='" & ZBBC & "' and jllx='" & Trim(Combo1.Text) & "'"
Set RS = ZHCX.Execute(sql2, 0)
If Not IsNull(RS(0)) Then
jjbjlxh = RS(0) + 1
Else
jjbjlxh = 1
End If
If RS.State Then
RS.Close
End If
Adodc1.Recordset.AddNew
DataGrid1.Columns(0).Value = ID
DataGrid1.Columns(1).Value = jjbjlxh
DataGrid1.Columns(2).Value = Format(DTPicker1.Value, "yyyy-mm-dd")
DataGrid1.Columns(3).Value = Trim(ZBBC)
DataGrid1.Columns(4).Value = Trim(Combo1.Text)
DataGrid1.Columns(5).Value = Trim(Text3.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
DataGrid1.Refresh
Call Close_link
Call sx
Text3.Text = ""
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.EOF Then
A = MsgBox("不能修改空记录!", vbOKOnly)
Exit Sub
End If
Call Open_link
A = MsgBox("是否真的修改该记录!", vbYesNo)
If A = 6 Then
sql1 = "update xdgl_jjbfb set jllx='" & Trim(Combo1.Text) & "',jlnr='" & Trim(Text3.Text) & "' where id=" & Text4.Text & ""
Set RS = ZHCX.Execute(sql1, 0)
Adodc1.Recordset.Update
Adodc1.Refresh
DataGrid1.Refresh
End If
Call Close_link
Call sx
End Sub
Private Sub Command3_Click()
A = MsgBox("是否真的删除该记录", vbYesNo)
If A = 6 Then
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Delete
Else
Exit Sub
End If
Else
Exit Sub
End If
Adodc1.Recordset.Update
Adodc1.Refresh
DataGrid1.Refresh
Call sx
End Sub
Private Sub Command4_Click()
If Adodc2.Recordset.EOF Then
A = MsgBox("所选记录为空", vbOKOnly)
Exit Sub
End If
Call Open_link
sql1 = "select max(id) from xdgl_jjbfb"
Set RS = ZHCX.Execute(sql1, 0)
If Not IsNull(RS(0)) Then
ID = RS(0) + 1
Else
ID = 1
End If
If RS.State Then
RS.Close
End If
sql2 = "select max(jlxh) from xdgl_jjbfb where jbrq='" & Format(Now, "yyyy-mm-dd") & "' and jbbc='" & ZBBC & "' and jllx='" & Trim(Combo1.Text) & "'"
Set RS = ZHCX.Execute(sql2, 0)
If Not IsNull(RS(0)) Then
jjbjlxh = RS(0) + 1
Else
jjbjlxh = 1
End If
If RS.State Then
RS.Close
End If
If Option1.Value Then
If Option3.Value Then
Adodc1.Recordset.AddNew
DataGrid1.Columns(0).Value = ID
DataGrid1.Columns(1).Value = jjbjlxh
DataGrid1.Columns(2).Value = Format(Now, "yyyy-mm-dd")
DataGrid1.Columns(3).Value = ZBBC
DataGrid1.Columns(4).Value = Trim(Combo1.Text)
DataGrid1.Columns(5).Value = Trim(DataGrid2.Columns(8).Value)
DataGrid1.Columns(6).Value = DataGrid2.Columns(9).Value
Else
End If
End If
If Option2.Value Then
If Option3.Value Then
hisjllx = DataGrid2.Columns(4).Value
sql2 = "select max(jlxh) from xdgl_jjbfb where jbrq='" & Format(Now, "yyyy-mm-dd") & "' and jbbc='" & ZBBC & "' and jllx='" & Trim(hisjllx) & "'"
Set RS = ZHCX.Execute(sql2, 0)
If Not IsNull(RS(0)) Then
jjbjlxh = RS(0) + 1
Else
jjbjlxh = 1
End If
If RS.State Then
RS.Close
End If
Adodc1.Recordset.AddNew
DataGrid1.Columns(0).Value = ID
DataGrid1.Columns(1).Value = jjbjlxh
DataGrid1.Columns(2).Value = Format(Now, "yyyy-mm-dd")
DataGrid1.Columns(3).Value = ZBBC
DataGrid1.Columns(4).Value = DataGrid2.Columns(4).Value
DataGrid1.Columns(5).Value = Trim(DataGrid2.Columns(5).Value)
DataGrid1.Columns(6).Value = ID
Else
If Option4.Value Then
j = 0
Adodc2.Recordset.MoveFirst
Do While Not Adodc2.Recordset.EOF
hisjllx = DataGrid2.Columns(4).Value
sql2 = "select max(jlxh) from xdgl_jjbfb where jbrq='" & Format(Now, "yyyy-mm-dd") & "' and jbbc='" & ZBBC & "' and jllx='" & Trim(hisjllx) & "'"
Set RS = ZHCX.Execute(sql2, 0)
' If Not IsNull(RS(0)) Then
' jjbjlxh = RS(0) + 1
' Else
' jjbjlxh = 1
' End If
If RS.State Then
RS.Close
End If
Adodc1.Recordset.AddNew
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -