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

📄 formclass1.frm

📁 prescription management
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Formclass1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "添加方剂"
   ClientHeight    =   8940
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9870
   Icon            =   "Formclass1.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8940
   ScaleWidth      =   9870
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   675
      Index           =   8
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   19
      Text            =   "Formclass1.frx":0442
      Top             =   7080
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   660
      Index           =   7
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   18
      Text            =   "Formclass1.frx":0448
      Top             =   6240
      Width           =   7695
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   255
      Left            =   5280
      TabIndex        =   12
      Top             =   8280
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   255
      Left            =   2880
      TabIndex        =   11
      Top             =   8280
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   765
      Index           =   6
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   10
      Text            =   "Formclass1.frx":044E
      Top             =   5400
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   795
      Index           =   5
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   8
      Text            =   "Formclass1.frx":0454
      Top             =   4440
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   1020
      Index           =   4
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   6
      Text            =   "Formclass1.frx":045A
      Top             =   3240
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   660
      Index           =   3
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   5
      Text            =   "Formclass1.frx":0460
      Top             =   2400
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   1020
      Index           =   2
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   4
      Text            =   "Formclass1.frx":0466
      Top             =   1200
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   300
      Index           =   1
      Left            =   1320
      MultiLine       =   -1  'True
      TabIndex        =   2
      Text            =   "Formclass1.frx":046C
      Top             =   840
      Width           =   7695
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   300
      Index           =   0
      Left            =   1320
      MultiLine       =   -1  'True
      TabIndex        =   1
      Text            =   "Formclass1.frx":0472
      Top             =   360
      Width           =   7695
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      Caption         =   "备注:"
      ForeColor       =   &H00800000&
      Height          =   735
      Left            =   240
      TabIndex        =   21
      Top             =   7080
      Width           =   975
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      Caption         =   "服用禁忌:"
      ForeColor       =   &H00800000&
      Height          =   735
      Left            =   240
      TabIndex        =   20
      Top             =   5400
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "用法:"
      ForeColor       =   &H00800000&
      Height          =   735
      Index           =   5
      Left            =   240
      TabIndex        =   17
      Top             =   4440
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "主治:"
      ForeColor       =   &H00800000&
      Height          =   1095
      Index           =   4
      Left            =   240
      TabIndex        =   16
      Top             =   3240
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "功效:"
      ForeColor       =   &H00800000&
      Height          =   615
      Index           =   3
      Left            =   240
      TabIndex        =   15
      Top             =   2520
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "组成:"
      ForeColor       =   &H00800000&
      Height          =   1095
      Index           =   2
      Left            =   240
      TabIndex        =   14
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "方名:"
      ForeColor       =   &H00800000&
      Height          =   255
      Index           =   1
      Left            =   240
      TabIndex        =   13
      Top             =   360
      Width           =   975
   End
   Begin VB.Label Label8 
      Alignment       =   2  'Center
      Caption         =   "典型病案:"
      ForeColor       =   &H00800000&
      Height          =   615
      Left            =   240
      TabIndex        =   9
      Top             =   6240
      Width           =   975
   End
   Begin VB.Label Label7 
      Height          =   255
      Left            =   2880
      TabIndex        =   7
      Top             =   2040
      Width           =   615
   End
   Begin VB.Label Label4 
      Height          =   255
      Left            =   600
      TabIndex        =   3
      Top             =   1920
      Width           =   615
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "方源:"
      ForeColor       =   &H00800000&
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   0
      Top             =   840
      Width           =   975
   End
End
Attribute VB_Name = "Formclass1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim classstr As String

Public Sub classload()
Dim mrc As ADODB.Recordset

If classmodi Then  '如果是修改状态
  Me.Caption = "方剂修改设置"
  classstr = "select * from prescribe where 方名='" & Trim(Formclass2.MSF1.TextMatrix(Formclass2.MSF1.Row, 1)) & "'"
  Set mrc = ExecuteSQL(classstr)
  mrc.MoveFirst
  For i = 0 To 8
   'Text1(I).MaxLength = Len(mrc.Fields(I))
   If IsNull(mrc.Fields(i)) Then
   Text1(i).text = ""
   Else
   Text1(i).text = mrc.Fields(i)
   End If
  Next i
  mrc.Close
Else
  Me.Caption = "添加方剂设置"
 For i = 0 To 8
   'Text1(i).MaxLength = 0
   Text1(i).text = ""
  Next i
 End If
End Sub

Private Sub Command1_Click()
 If Text1(0) = "" Or Text1(1) = "" Or Text1(2) = "" Or Text1(8) = "" Then
     ss = MsgBox("方名、方源、组成、备注不能为空!", vbExclamation + vbOKOnly, "警告")
     Text1(0).SetFocus
     Text1(0).SelStart = 0
     Text1(0).SelLength = Len(Text1(0).text)
    Exit Sub
   End If

Dim mrc As ADODB.Recordset
If classmodi = False Then
  classstr = "select * from prescribe where 方名='" & Trim(Text1(0).text) & "'"
  Set mrc = ExecuteSQL(classstr)
  If mrc.EOF = False Then
   sss = MsgBox("已经存在该方剂的设置,不能重复!", vbonly, "警告")
   Text1(0).SetFocus
   Text1(0).SelStart = 0
   Text1(0).SelLength = Len(Text1(0).text)
   mrc.Close
   Exit Sub
  End If
 End If
 
classstr = "delete * from prescribe where 方名='" & Trim(Text1(0).text) & "'"
Set mrc = ExecuteSQL(classstr)
classstr = "select * from prescribe "
Set mrc = ExecuteSQL(classstr)

  mrc.AddNew
   For i = 0 To 8
     mrc.Fields(i) = Text1(i).text
   Next i
  mrc.Update
  
If classmodi Then
  sss = MsgBox("添加成功!", vbYes, "")
  Unload Me
  'Formclass2.classshowtitle
  'Formclass2.classshowdata
Else
sss = MsgBox("添加成功,是否继续添加?", vbYesNo + vbQuestion, "")
Select Case sss
Case vbYes
For j = 0 To 8
   Text1(j) = ""
Next
  'MDIForm1.classbrowse_Click

Case vbNo
Unload Me
End Select
End If

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Activate()
Text1(0).SetFocus
End Sub

⌨️ 快捷键说明

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