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

📄 flcsh.frm

📁 医院管理系统已经在运行中
💻 FRM
📖 第 1 页 / 共 3 页
字号:
   If Adodc1.Recordset.EOF = False Then
      Adodc1.Recordset.MoveLast
      bh = Mid(Adodc1.Recordset.Fields(0), 1, 2) & Trim(Str(Val(Mid(Adodc1.Recordset.Fields(0), 3)) + 1))
      Text1.Text = bh
   Else
      Text1.Text = "cj1"
   End If
   Text2.SetFocus
   bb = 111
End Sub



Private Sub Command10_Click()

End Sub

Private Sub Command11_Click()
   Text5.Text = ""
   Text6.Locked = False
   Command11.Enabled = False
   Command12.Enabled = False
   Command13.Enabled = False
   Command14.Enabled = True
   Command15.Enabled = False
   'Adodc3.Refresh
   If Adodc3.Recordset.EOF = False Then
      Adodc3.Recordset.MoveLast
      bhh = Mid(Adodc3.Recordset.Fields(0), 1, 2) & Trim(Str(Val(Mid(Adodc3.Recordset.Fields(0), 3)) + 1))
      Text5.Text = bhh
   Else
      Text5.Text = "kb1"
   End If
   Text6.SetFocus
   dd = 111
End Sub

Private Sub Command12_Click()
   Adodc3.Recordset.Delete
   DataGrid3.Refresh
   Text5.Text = ""
   Text6.Text = ""
   MsgBox "已经成功删除了您所要删除的科别!"
End Sub

Private Sub Command13_Click()
  Text6.Locked = False
  Text6.SelStart = Len(Text6.Text)
  Text6.SetFocus
  dd = 222
  Command11.Enabled = False
  Command12.Enabled = False
  Command13.Enabled = False
  Command14.Enabled = True
  Command15.Enabled = False
End Sub

Private Sub Command14_Click()
On Error GoTo er
    If Text6.Text = "" Then
      MsgBox "科室名称不能为空"
      Text6.SetFocus
      Exit Sub
   End If
  If dd = 111 Then
     Adodc3.Refresh
     Adodc3.Recordset.Find ("科室名称=" + "'" + Text6.Text + "'")
     If Adodc3.Recordset.EOF = True Then
        Adodc3.Recordset.AddNew
        Adodc3.Recordset.Fields(0) = Text5.Text
        Adodc3.Recordset.Fields(1) = Text6.Text
        Adodc3.Recordset.Update
        Command14.Enabled = False
        Command11.Enabled = True
        Command12.Enabled = True
        Command13.Enabled = True
        Command15.Enabled = True
        Text5.Text = ""
        Text6.Text = ""
        Text6.Locked = True
        Command11.SetFocus
        DataGrid3.Refresh
     Else
        MsgBox "科室名称已经存在,请输入其他科室名称"
        Text6.Text = ""
        Text6.SetFocus
     End If
  End If
  If dd = 222 Then
     Adodc3.Recordset.Fields(1) = Text6.Text
     Adodc3.Recordset.Update
     DataGrid3.Refresh
     Text6.Locked = True
     Command14.Enabled = False
     Command11.Enabled = True
     Command12.Enabled = True
     Command13.Enabled = True
     Command15.Enabled = True
     Command11.SetFocus
   End If
   Exit Sub
er:
  MsgBox "服务器连接失败。!"
End Sub

Private Sub Command15_Click()
    mc = InputBox("请输入您要查找的科室的名称")
    Adodc3.Refresh
    Adodc3.Recordset.Find ("科室名称=" + "'" + mc + "'")
    If Adodc3.Recordset.EOF = False Then
       Call disp2
    Else
       MsgBox "没有找到名称为“" & mc & "”的科室"
    End If
End Sub

Private Sub Command16_Click()
    mc = InputBox("请输入您要查找的医师姓名")
    Adodc4.Refresh
    Adodc4.Recordset.Find ("医师姓名=" + "'" + mc + "'")
    If Adodc4.Recordset.EOF = False Then
       Call disp3
    Else
       MsgBox "没有找到姓名为“" & mc & "”的医师"
    End If
End Sub

Private Sub Command17_Click()
On Error GoTo er
   If Text8.Text = "" Or Combo1.Text = "" Then
      MsgBox "医师姓名或医师所在科室不能为空"
      Text8.SetFocus
      Exit Sub
   End If
  If ee = 111 Then
     Adodc4.Refresh
     Adodc4.Recordset.Find ("医师姓名=" + "'" + Text8.Text + "'")
     If Adodc4.Recordset.EOF = True Then
        Adodc4.Recordset.AddNew
        Adodc4.Recordset.Fields(0) = Text7.Text
        Adodc4.Recordset.Fields(1) = Text8.Text
        Adodc4.Recordset.Fields(2) = Combo1.Text
        Adodc4.Recordset.Update
        Command17.Enabled = False
        Command20.Enabled = True
        Command19.Enabled = True
        Command18.Enabled = True
        Command16.Enabled = True
        Text7.Text = ""
        Text8.Text = ""
        Combo1.Text = ""
        Text8.Locked = True
        Command20.SetFocus
        DataGrid4.Refresh
     Else
        MsgBox "医师姓名已经存在,请输入其他医师"
        Text8.Text = ""
        Text8.SetFocus
     End If
  End If
  If ee = 222 Then
     Adodc4.Recordset.Fields(1) = Text8.Text
     Adodc4.Recordset.Fields(2) = Combo1.Text
     Adodc4.Recordset.Update
     DataGrid4.Refresh
     Text8.Locked = True
     Command17.Enabled = False
     Command20.Enabled = True
     Command19.Enabled = True
     Command18.Enabled = True
     Command17.Enabled = True
     Command20.SetFocus
   End If
   Exit Sub
er:
  MsgBox "服务器连接失败。!"
End Sub

Private Sub Command18_Click()
  Text8.Locked = False
  Text8.SelStart = Len(Text6.Text)
  Text8.SetFocus
  ee = 222
  Command20.Enabled = False
  Command19.Enabled = False
  Command18.Enabled = False
  Command17.Enabled = True
  Command16.Enabled = False
End Sub

Private Sub Command19_Click()
   Adodc4.Recordset.Delete
   DataGrid4.Refresh
   Text7.Text = ""
   Text8.Text = ""
   Combo1.Text = ""
   MsgBox "已经成功删除了您所要删除的医师!"
End Sub

Private Sub Command2_Click()
   Adodc1.Recordset.Delete
   DataGrid1.Refresh
   Text1.Text = ""
   Text2.Text = ""
   MsgBox "已经成功删除了您所要删除的厂家!"
End Sub

Private Sub Command20_Click()
   Text8.Text = ""
   Text8.Locked = False
   Combo1.Text = ""
   Command20.Enabled = False
   Command19.Enabled = False
   Command18.Enabled = False
   Command17.Enabled = True
   Command16.Enabled = False
   'Adodc3.Refresh
   If Adodc4.Recordset.EOF = False Then
      Adodc4.Recordset.MoveLast
      bhhh = Mid(Adodc4.Recordset.Fields(0), 1, 2) & Trim(Str(Val(Mid(Adodc4.Recordset.Fields(0), 3)) + 1))
      Text7.Text = bhhh
   Else
      Text7.Text = "ys1"
   End If
   Text8.SetFocus
   ee = 111
End Sub

Private Sub Command21_Click()
   Unload Me
End Sub

Private Sub Command3_Click()
  Text2.Locked = False
  Text2.SelStart = Len(Text2.Text)
  Text2.SetFocus
  bb = 222
  Command1.Enabled = False
  Command2.Enabled = False
  Command3.Enabled = False
  Command4.Enabled = True
  Command5.Enabled = False
End Sub

Private Sub Command4_Click()
On Error GoTo er
   If Text2.Text = "" Then
      MsgBox "厂家名称不能为空"
      Text2.SetFocus
      Exit Sub
   End If
  If bb = 111 Then
     Adodc1.Refresh
     Adodc1.Recordset.Find ("厂家名称=" + "'" + Text2.Text + "'")
     If Adodc1.Recordset.EOF = True Then
        Adodc1.Recordset.AddNew
        Adodc1.Recordset.Fields(0) = Text1.Text
        Adodc1.Recordset.Fields(1) = Text2.Text
        Adodc1.Recordset.Update
        Command4.Enabled = False
        Command1.Enabled = True
        Command2.Enabled = True
        Command3.Enabled = True
        Command5.Enabled = True
        Text1.Text = ""
        Text2.Text = ""
        Text2.Locked = True
        Command1.SetFocus
        DataGrid1.Refresh
     Else
        MsgBox "厂家名称已经存在,请输入其他厂家"
        Text2.Text = ""
        Text2.SetFocus
     End If
  End If
  If bb = 222 Then
     Adodc1.Recordset.Fields(1) = Text2.Text
     Adodc1.Recordset.Update
     DataGrid1.Refresh
     Text2.Locked = True
     Command4.Enabled = False
     Command1.Enabled = True
     Command2.Enabled = True
     Command3.Enabled = True
     Command5.Enabled = True
     Command1.SetFocus
   End If
   Exit Sub
er:
  MsgBox "服务器连接失败。!"
End Sub

Private Sub Command5_Click()
    mc = InputBox("请输入您要查找的厂家的名称")
    Adodc1.Refresh
    Adodc1.Recordset.Find ("厂家名称=" + "'" + mc + "'")
    If Adodc1.Recordset.EOF = False Then
       Call disp
    Else
       MsgBox "没有找到名称为“" & mc & "”的厂家"
    End If
End Sub


Private Sub Command6_Click()

End Sub

Private Sub DataGrid1_Click()
  Call disp
End Sub


Sub disp2()
   If IsNull(Adodc3.Recordset.Fields(0)) = False Then
     Text5.Text = Adodc3.Recordset.Fields(0)
  End If
  If IsNull(Adodc3.Recordset.Fields(1)) = False Then
     Text6.Text = Adodc3.Recordset.Fields(1)
  End If
End Sub

Private Sub DataGrid3_Click()
  Call disp2
End Sub

Private Sub DataGrid4_Click()
  Call disp3
End Sub
Sub disp3()
   If IsNull(Adodc4.Recordset.Fields(0)) = False Then
     Text7.Text = Adodc4.Recordset.Fields(0)
  End If
  If IsNull(Adodc4.Recordset.Fields(1)) = False Then
     Text8.Text = Adodc4.Recordset.Fields(1)
  End If
  If IsNull(Adodc4.Recordset.Fields(2)) = False Then
     Combo1.Text = Adodc4.Recordset.Fields(2)
  End If
End Sub
Private Sub Form_Activate()
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Frame2.Visible = False
Frame5.Visible = False
Frame8.Visible = False
Frame11.Visible = False
Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + dbstr
Adodc3.RecordSource = "科别"
Adodc3.Refresh

End Sub
Sub disp()
  If IsNull(Adodc1.Recordset.Fields(0)) = False Then
     Text1.Text = Adodc1.Recordset.Fields(0)
  End If
  If IsNull(Adodc1.Recordset.Fields(1)) = False Then
     Text2.Text = Adodc1.Recordset.Fields(1)
  End If
End Sub
Private Sub Option1_Click()
   If Option1.Value = True Then
      Frame5.Visible = False
      Frame8.Visible = False
      Frame11.Visible = False
      Frame2.Visible = True
      Frame2.Left = Frame1.Left
      Frame2.Top = 1680
      Text1.Text = ""
      Text2.Text = ""
      Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + dbstr
      Adodc1.RecordSource = "厂家"
      Adodc1.Refresh
      Command1.SetFocus
   End If
End Sub

Private Sub Option2_Click()

If Option2.Value = True Then
      Frame2.Visible = False
      Frame8.Visible = False
      Frame5.Visible = True
      Frame11.Visible = False
      Frame5.Top = 1680
      Frame5.Left = Frame1.Left + 1200
      Adodc5.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + dbstr
      Adodc5.RecordSource = "门诊处方"
      Adodc5.Refresh
      Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + dbstr
      Adodc2.RecordSource = "处方类别"
      Adodc2.Refresh
      While Adodc2.Recordset.EOF = False
         Adodc2.Recordset.Delete
         Adodc2.Recordset.MoveNext
      Wend
      For k = 6 To 19
         Adodc2.Recordset.AddNew
         Adodc2.Recordset.Fields(0) = "chflb" & k - 5
         Adodc2.Recordset.Fields(1) = Adodc5.Recordset.Fields(k).Name
         Adodc2.Recordset.Update
      Next k
      MsgBox "处方类别已经成功初始化!。"
   End If
End Sub

Private Sub Option3_Click()
If Option3.Value = True Then
      Frame2.Visible = False
      Frame8.Visible = False
      Frame5.Visible = False
      Frame11.Visible = True
      Frame11.Left = Frame1.Left
      Frame11.Top = 1680
      Text7.Text = ""
      Text8.Text = ""
      Adodc4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + dbstr
      Adodc4.RecordSource = "医师"
      Adodc4.Refresh
      Command20.SetFocus
      Adodc3.Refresh
      Combo1.Clear
      While Adodc3.Recordset.EOF = False
         Combo1.AddItem Adodc3.Recordset.Fields(1)
         Adodc3.Recordset.MoveNext
      Wend
      Combo1.Text = ""
   End If
End Sub

Private Sub Option4_Click()
If Option4.Value = True Then
      Frame2.Visible = False
      Frame5.Visible = False
      Frame8.Visible = True
      Frame11.Visible = False
      Frame8.Left = Frame1.Left
      Frame8.Top = 1680
      Text5.Text = ""
      Text6.Text = ""
      Command11.SetFocus
   End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
      Command4.SetFocus
   End If
End Sub


Private Sub Text4_Change()

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     Command14.SetFocus
  End If
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
      Combo1.SetFocus
   End If
End Sub

⌨️ 快捷键说明

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