www.pudn.com > textmanager.rar > FrmSet.frm, change:2005-04-12,size:8280b


VERSION 5.00 
Begin VB.Form FrmSet  
   BorderStyle     =   0  'None 
   Caption         =   "Form1" 
   ClientHeight    =   1395 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   6135 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   ScaleHeight     =   1395 
   ScaleWidth      =   6135 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.ComboBox CmbNianji  
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   360 
      Left            =   2490 
      Style           =   2  'Dropdown List 
      TabIndex        =   3 
      Top             =   690 
      Width           =   2070 
   End 
   Begin VB.ComboBox CmbKeMu  
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   360 
      Left            =   135 
      Style           =   2  'Dropdown List 
      TabIndex        =   1 
      Top             =   705 
      Width           =   2205 
   End 
   Begin VB.Label Label4  
      Alignment       =   2  'Center 
      Appearance      =   0  'Flat 
      BackColor       =   &H0080C0FF& 
      BorderStyle     =   1  'Fixed Single 
      Caption         =   "取消" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H80000008& 
      Height          =   345 
      Left            =   4815 
      MouseIcon       =   "FrmSet.frx":0000 
      MousePointer    =   99  'Custom 
      TabIndex        =   5 
      Top             =   825 
      Width           =   975 
   End 
   Begin VB.Label Label3  
      Alignment       =   2  'Center 
      Appearance      =   0  'Flat 
      BackColor       =   &H0080C0FF& 
      BorderStyle     =   1  'Fixed Single 
      Caption         =   "确定" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H80000008& 
      Height          =   345 
      Left            =   4815 
      MouseIcon       =   "FrmSet.frx":0442 
      MousePointer    =   99  'Custom 
      TabIndex        =   4 
      Top             =   255 
      Width           =   975 
   End 
   Begin VB.Label Label2  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "请选择年级范围:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   210 
      Left            =   2460 
      TabIndex        =   2 
      Top             =   330 
      Width           =   1575 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "请选择要处理的科目:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   210 
      Left            =   90 
      TabIndex        =   0 
      Top             =   330 
      Width           =   1995 
   End 
   Begin VB.Shape Shape1  
      BackColor       =   &H00FFC0C0& 
      BackStyle       =   1  'Opaque 
      BorderWidth     =   2 
      Height          =   1380 
      Left            =   15 
      Top             =   15 
      Width           =   6120 
   End 
End 
Attribute VB_Name = "FrmSet" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Dim KeMuIdArr() As Long 
Dim NianJiIdArr() As Long 
Private Sub Form_Load() 
 Dim adokemuRs As Recordset 
 Dim adoNianJiRs As Recordset 
 Set adokemuRs = New Recordset 
 Set adoNianJiRs = New Recordset 
 Dim KeMuQXStr As String 
 '如果是总管理员就不检查权限。 
 If UserCode <> "admin" Then 
    adokemuRs.Open "select kemuQX from admin where code='" & UserCode & "'", DB, adOpenStatic, adLockOptimistic 
    KeMuQXStr = adokemuRs.Fields(0).Value 
    adokemuRs.Close 
    If KeMuQXStr = "" Then 
      Exit Sub 
    End If 
    adokemuRs.Open "select * from kemu where id in(" + KeMuQXStr + ")", DB, adOpenStatic, adLockOptimistic 
   Else 
    adokemuRs.Open "kemu", DB, adOpenStatic, adLockOptimistic 
  End If 
 If Not adokemuRs.EOF Then 
   adokemuRs.MoveLast 
   adokemuRs.MoveFirst 
   ReDim KeMuIdArr(adokemuRs.RecordCount) As Long 
    '添加到控件 
   Do While Not adokemuRs.EOF 
      KeMuIdArr(adokemuRs.AbsolutePosition - 1) = adokemuRs.Fields("id").Value 
      CmbKeMu.AddItem adokemuRs.Fields("name").Value 
      adokemuRs.MoveNext 
   Loop 
   CmbKeMu.ListIndex = 0 
 End If 
 Set adokemuRs = Nothing 
  
 adoNianJiRs.Open "nianji", DB, adOpenStatic, adLockOptimistic 
 If Not adoNianJiRs.EOF Then 
   adoNianJiRs.MoveLast 
   adoNianJiRs.MoveFirst 
   ReDim NianJiIdArr(adoNianJiRs.RecordCount) As Long 
    '添加到控件 
   Do While Not adoNianJiRs.EOF 
      NianJiIdArr(adoNianJiRs.AbsolutePosition - 1) = adoNianJiRs.Fields("id").Value 
      CmbNianJi.AddItem adoNianJiRs.Fields("name").Value 
      adoNianJiRs.MoveNext 
   Loop 
   CmbNianJi.ListIndex = 0 
 End If 
 Set adoNianJiRs = Nothing 
  
End Sub 
 
Private Sub Label3_Click() 
 If CmbKeMu.Text = "" Then 
   MsgBox "没有科目信息,请你先添加科目信息表!" + vbCrLf + "或者联系系统管理员付给你操作科目权限!" 
   Unload Me 
   Exit Sub 
 End If 
 If CmbNianJi.Text = "" Then 
   MsgBox "没有年级信息,请你先添加年级信息表!" 
   Unload Me 
   Exit Sub 
 End If 
 'FrmFlash.Show 1 
' DoEvents 
 UseKeMuID = KeMuIdArr(CmbKeMu.ListIndex) 
 UseNianJiID = NianJiIdArr(CmbNianJi.ListIndex) 
 'MsgBox CmbKeMu.Text 
 'MsgBox UseKeMuID 
   Unload Me 
Select Case UseForm 
 Case "FrmQuestion" 
  frmquestion.CmbKeMu.AddItem CmbKeMu.Text 
  frmquestion.CmbKeMu.ListIndex = 0 
  frmquestion.CmbNianJi.AddItem CmbNianJi.Text 
  frmquestion.CmbNianJi.ListIndex = 0 
  frmquestion.Show 1 
 Case "FrmShiJuan" 
  FrmShiJuan.LabKeMu.Caption = CmbKeMu.Text 
  FrmShiJuan.LabNianJi.Caption = CmbNianJi.Text 
  FrmShiJuan.Show 1 
 Case "FrmTianKong" 
  FrmTianKong.LabKeMu.Caption = CmbKeMu.Text 
  FrmTianKong.LabNianJi.Caption = CmbNianJi.Text 
  FrmTianKong.Show 1 
 Case "FrmPanDuan" 
  FrmPanDuan.LabKeMu.Caption = CmbKeMu.Text 
  FrmPanDuan.LabNianJi.Caption = CmbNianJi.Text 
  FrmPanDuan.Show 1 
 Case "FrmWenDa" 
  FrmWenDa.LabKeMu.Caption = CmbKeMu.Text 
  FrmWenDa.LabNianJi.Caption = CmbNianJi.Text 
  FrmWenDa.Show 1 
 Case "FrmZuoWen" 
  FrmZuoWen.LabKeMu.Caption = CmbKeMu.Text 
  FrmZuoWen.LabNianJi.Caption = CmbNianJi.Text 
  FrmZuoWen.Show 1 
 Case "FrmSheZhi" 
  FrmShezhi.LabKeMu.Caption = CmbKeMu.Text 
  FrmShezhi.LabNianJi.Caption = CmbNianJi.Text 
  FrmShezhi.Show 1 
 Case "FrmPanJuan" 
  FrmPanJuan.LabKeMu.Caption = CmbKeMu.Text 
  FrmPanJuan.LabNianJi.Caption = CmbNianJi.Text 
  FrmPanJuan.Show 1 
   
End Select 
 
   
 
End Sub 
 
Private Sub Label4_Click() 
 Unload Me 
  
End Sub