⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmpublishquery.frm

📁 本套程序是一款基于VB+Access实现的轻型杂志分发管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmpublishquery 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "出版社查询"
   ClientHeight    =   2550
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4905
   Icon            =   "frmpublishquery.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2550
   ScaleWidth      =   4905
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.OptionButton Option1 
      Caption         =   "杂志名称"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   1
      Left            =   480
      TabIndex        =   5
      Top             =   1320
      Width           =   1215
   End
   Begin VB.OptionButton Option1 
      Caption         =   "邮发代号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   0
      Left            =   480
      TabIndex        =   4
      Top             =   600
      Value           =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton Cmdexit 
      Caption         =   " 退出(&E)"
      Height          =   375
      Left            =   2880
      TabIndex        =   3
      Top             =   1920
      Width           =   975
   End
   Begin VB.CommandButton Cmdadd 
      Caption         =   " 查询(Q)"
      Height          =   375
      Left            =   1560
      TabIndex        =   2
      Top             =   1920
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   1
      Left            =   1800
      TabIndex        =   1
      Top             =   1200
      Width           =   2895
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   390
      Index           =   0
      Left            =   1800
      TabIndex        =   0
      Top             =   480
      Width           =   1335
   End
End
Attribute VB_Name = "frmpublishquery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim checktextnum As Integer
'Download by http://www.codefans.net
Private Sub Cmdadd_Click()
Dim sql As String

'MsgBox checktextnum
'//检验检索项输入完整
If Text1(checktextnum).Text = "" Then
 MsgBox "请输入检索信息!", vbInformation, ""
 Text1(checktextnum).SetFocus
 Exit Sub
End If

If checktextnum = 0 Then
  If Me.Caption = "出版社查询" Then
     sql = "select * from magazine where  code like '%" & Trim(Text1(0).Text) & "%'"
  Else
     sql = "select * from teacher where  name like '%" & Trim(Text1(0).Text) & "%'"
  End If
Else
  If Me.Caption = "出版社查询" Then
     sql = "select * from magazine where magazine like '%" & Trim(Text1(1).Text) & "%'"
  Else
     sql = "select * from teacher where office  like '%" & Trim(Text1(1).Text) & "%'"
  End If
End If

If Me.Caption = "出版社查询" Then
  Frmpublishmodify.Adodc1.CommandType = adCmdText
  Frmpublishmodify.Adodc1.RecordSource = sql
  Frmpublishmodify.Adodc1.Refresh
  Frmpublishmodify.Adodc1.CommandType = adCmdTable
  Unload Me
  If Frmpublishmodify.Adodc1.Recordset.RecordCount = 0 Then
    MsgBox "没有您要找的相关内容!", vbInformation, "结果"
  Else
    Frmpublishmodify.Show
  End If
Else
  Frmreadermodify.Adodc1.CommandType = adCmdText
  Frmreadermodify.Adodc1.RecordSource = sql
  Frmreadermodify.Adodc1.Refresh
  Frmreadermodify.Adodc1.CommandType = adCmdTable
  Unload Me
  If Frmreadermodify.Adodc1.Recordset.RecordCount = 0 Then
    MsgBox "没有您要找的相关内容!", vbInformation, "结果"
  Else
    Frmreadermodify.Show
  End If
End If
End Sub
Private Sub Cmdexit_Click()
Unload Me
End Sub


Private Sub Form_Load()
checktextnum = 0
End Sub

Private Sub Option1_Click(Index As Integer)
Dim i As Integer
'//设置只能用一项进行检索
For i = 0 To 1
 If Me.Option1(i).Value = True Then
   checktextnum = i
   Text1(i).Enabled = True
   Text1(i).SetFocus
   Text1((i + 1) Mod 2).Enabled = False
 End If
Next i

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -