📄 frjsjck.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frjSJCK
ClientHeight = 5760
ClientLeft = 48
ClientTop = 48
ClientWidth = 8136
ControlBox = 0 'False
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 5760
ScaleWidth = 8136
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "试卷查询"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 5568
Left = 72
TabIndex = 0
Top = 60
Width = 8016
Begin VB.CommandButton Command4
Caption = "确定"
Height = 396
Left = 5316
TabIndex = 6
Top = 5016
Width = 1128
End
Begin VB.ComboBox Combo1
Height = 312
ItemData = "frjSJCK.frx":0000
Left = 132
List = "frjSJCK.frx":000A
Style = 2 'Dropdown List
TabIndex = 5
Top = 696
Width = 2580
End
Begin VB.TextBox Text1
Height = 348
Left = 2748
TabIndex = 4
Top = 696
Width = 3108
End
Begin VB.CommandButton Command1
Caption = "列出全部"
Height = 396
Left = 108
TabIndex = 3
Top = 1080
Width = 1128
End
Begin VB.CommandButton Command2
Caption = "查询..."
Height = 384
Left = 6060
TabIndex = 2
Top = 672
Width = 1128
End
Begin VB.CommandButton Command3
Caption = "关闭"
Height = 396
Left = 6528
TabIndex = 1
Top = 5016
Width = 1128
End
Begin MSFlexGridLib.MSFlexGrid MFGrid1
Height = 3384
Left = 60
TabIndex = 7
Top = 1524
Width = 7764
_ExtentX = 13695
_ExtentY = 5969
_Version = 393216
FocusRect = 0
HighLight = 2
SelectionMode = 1
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "查询值:"
Height = 216
Left = 2772
TabIndex = 9
Top = 336
Width = 756
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "查询条件:"
Height = 216
Left = 144
TabIndex = 8
Top = 348
Width = 972
End
End
End
Attribute VB_Name = "frjSJCK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public m_Type As String
Public m_ID As String
Private m_sql As String
Private m_page_count As Integer
Private Rs As New ADODB.Recordset
Private Sub Combo1_Click()
Text1.Text = ""
If Combo1.ListIndex = 1 Then Text1.Text = Date
End Sub
Private Sub Command1_Click()
Call GetData("select * from sjk order by scrq")
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim sfield As String
Dim svalue As String
Dim sql As String
Dim svalue2 As String
svalue = Trim(Text1.Text)
If svalue = "" Then
MsgMsg "查询值为空!"
Text1.SetFocus
Exit Sub
End If
svalue2 = svalue
svalue = "" & svalue & ""
Select Case Combo1.ListIndex
Case 0
sfield = "sjmc like '%" & svalue & "%'"
Case 1
sfield = "scrq = #" & svalue & "#"
End Select
sql = "select * from sjk where " & sfield & " order by scrq"
Call GetData(sql)
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Call MFGrid1_DblClick
End Sub
Private Sub Command5_Click()
m_page_count = m_page_count + 1
ShowData
End Sub
Private Sub Command6_Click()
m_page_count = m_page_count - 1
ShowData
End Sub
Private Sub Form_Load()
Dim sSQL As String
MFGrid1.Rows = 1
MFGrid1.FormatString = "序号 |试卷名称 |考试类型 |生成日期 |套数|本套套号||"
Combo1.ListIndex = 0
If m_Type = SNEW Then
sSQL = "select * from sjk where FAID='" & m_ID & "' order by scrq "
GetData sSQL
Combo1.Enabled = False
Text1.Enabled = False
End If
End Sub
Private Sub Form_Resize()
SetWindowPos Me
End Sub
Private Sub GetData(ByVal sSQL As String)
m_sql = sSQL
If Rs.State <> adStateClosed Then
Rs.Close
End If
Rs.open sSQL, dbcon, adOpenKeyset, adLockOptimistic, adCmdText
If Rs.EOF And Rs.BOF Then
MFGrid1.Rows = 1
' MsgMsg "没有符合条件的记录!"
Exit Sub
End If
' rs.PageSize = 12
' m_page_count = 1
ShowData
End Sub
Public Sub ShowData()
On Error Resume Next
Dim col As Long
Dim row As Long
col = 0
row = 0
Dim icount As Long
With MFGrid1
.Clear
.Rows = 1
.Cols = 6
.FormatString = "序号 |试卷名称 |考试类型 |生成日期 |套数|本套套号||"
For icount = 1 To Rs.RecordCount
row = row + 1
.Rows = row + 1
.TextMatrix(row, 0) = row
.TextMatrix(row, 1) = Rs("sjmc")
.TextMatrix(row, 2) = Rs("sjlx")
.TextMatrix(row, 3) = Rs("scrq")
.TextMatrix(row, 4) = Rs("zts")
.TextMatrix(row, 5) = Rs("ts")
.TextMatrix(row, 6) = Rs("id")
.TextMatrix(row, 7) = Rs("faid")
Rs.MoveNext
Next
End With
End Sub
Private Sub MFGrid1_DblClick()
If MFGrid1.row <= 0 Then
Exit Sub
End If
frmSJGL.FA_ID = MFGrid1.TextMatrix(MFGrid1.row, 7)
ShowForm frmSJGL, SEDIT, MFGrid1.TextMatrix(MFGrid1.row, 6)
End Sub
Public Sub RefData()
GetData m_sql
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -